[oe-commits] org.oe.dreambox libdvdnav: add version 1.1.12 from xine tree

tmbinc commit oe at amethyst.openembedded.net
Wed Apr 23 08:35:54 UTC 2008


libdvdnav: add version 1.1.12 from xine tree

Author: tmbinc at openembedded.org
Branch: org.openembedded.dreambox
Revision: 68d6b2c3e827ff0c5dbd86294f5c388e767cb52d
ViewMTN: http://monotone.openembedded.org/revision/info/68d6b2c3e827ff0c5dbd86294f5c388e767cb52d
Files:
1
packages/libdvdnav/files
packages/libdvdnav/files/dvdnav-fix-read-dvdlabel.patch
packages/libdvdnav/files/dvdnav-xine-lib-1.1.12.patch
packages/libdvdnav/libdvdnav_1.1.12.bb
Diffs:

#
# mt diff -r1d7ea0cc01a0003704f69e04d9a402e98a40fb90 -r68d6b2c3e827ff0c5dbd86294f5c388e767cb52d
#
#
#
# add_dir "packages/libdvdnav/files"
# 
# add_file "packages/libdvdnav/files/dvdnav-fix-read-dvdlabel.patch"
#  content [e8c467bbeb4d81034115093064b29d07b0a35a40]
# 
# add_file "packages/libdvdnav/files/dvdnav-xine-lib-1.1.12.patch"
#  content [b7d512a509a0f6b48a693914e55dcaaab8cdc2cd]
# 
# add_file "packages/libdvdnav/libdvdnav_1.1.12.bb"
#  content [fad086c4c71c60631ceb879f58856f733b7ad497]
#
============================================================
--- packages/libdvdnav/files/dvdnav-fix-read-dvdlabel.patch	e8c467bbeb4d81034115093064b29d07b0a35a40
+++ packages/libdvdnav/files/dvdnav-fix-read-dvdlabel.patch	e8c467bbeb4d81034115093064b29d07b0a35a40
@@ -0,0 +1,52 @@
+--- libdvdnav-0.1.10-org/src/vm.c	2004-05-21 21:32:25.000000000 +0200
++++ libdvdnav-0.1.10/src/vm/vm.c	2008-04-15 13:25:33.000000000 +0200
+@@ -43,6 +43,10 @@
+ 
+ #include "dvdnav_internal.h"
+ 
++#if defined(__linux__)
++#include <mntent.h>
++#endif
++
+ #ifdef _MSC_VER
+ #include <io.h>   /* read() */
+ #endif /* _MSC_VER */
+@@ -131,7 +135,7 @@
+      * all off_t are 64bit.
+      */
+     off_t off;
+-    int fd, i;
++    int fd = 0, i;
+     uint8_t data[DVD_VIDEO_LB_LEN];
+ 
+     /* Read DVD name */
+@@ -141,6 +145,29 @@
+       if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
+         off = read( fd, data, DVD_VIDEO_LB_LEN ); 
+         close(fd);
++#if defined(__linux__)
++	if (off != ( (off_t) DVD_VIDEO_LB_LEN )) {
++		FILE *mntfile;
++		mntfile = fopen( MOUNTED, "r" );
++		if ( mntfile ) {
++			struct mntent *me;
++			while( ( me = getmntent( mntfile ) ) ) {
++				if( strstr( device, me->mnt_dir ) ) {
++					fprintf( stderr, "libdvdnav: Attempting to read dvd label from device %s mounted on %s \n", me->mnt_fsname, me->mnt_dir );
++					fd = open(me->mnt_fsname, O_RDONLY);
++				}
++			}
++			fclose( mntfile );
++		}
++		if (fd > 0) {
++			off = lseek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET );
++			if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
++				off = read( fd, data, DVD_VIDEO_LB_LEN );
++				close(fd);
++			}
++		}
++	}
++#endif
+         if (off == ( (off_t) DVD_VIDEO_LB_LEN )) {
+           fprintf(MSG_OUT, "libdvdnav: DVD Title: ");
+           for(i=25; i < 73; i++ ) {
============================================================
--- packages/libdvdnav/files/dvdnav-xine-lib-1.1.12.patch	b7d512a509a0f6b48a693914e55dcaaab8cdc2cd
+++ packages/libdvdnav/files/dvdnav-xine-lib-1.1.12.patch	b7d512a509a0f6b48a693914e55dcaaab8cdc2cd
@@ -0,0 +1,1459 @@
+diff -Naur libdvdnav-0.1.10-org/src/dvdnav.c libdvdnav-0.1.10/src/dvdnav.c
+--- libdvdnav-0.1.10-org/src/dvdnav.c	2004-01-31 18:12:58.000000000 +0100
++++ libdvdnav-0.1.10/src/dvdnav.c	2008-03-28 15:24:50.000000000 +0100
+@@ -16,9 +16,6 @@
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+- *
+- * $Id: dvdnav.c,v 1.63 2004/01/31 17:12:58 jcdutton Exp $
+- *
+  */
+ 
+ #ifdef HAVE_CONFIG_H
+@@ -67,7 +64,7 @@
+   struct timeval time;
+   
+   /* Create a new structure */
+-  fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s from http://dvd.sf.net\n", VERSION);
++  fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s from http://xine.sf.net\n", VERSION);
+ 
+   (*dest) = NULL;
+   this = (dvdnav_t*)malloc(sizeof(dvdnav_t));
+@@ -203,7 +200,7 @@
+ }
+ 
+ /* converts a dvd_time_t to PTS ticks */
+-static int64_t dvdnav_convert_time(dvd_time_t *time) {
++int64_t dvdnav_convert_time(dvd_time_t *time) {
+   int64_t result;
+   int64_t frames;
+   
+@@ -403,7 +400,10 @@
+   
+   if(!this->started) {
+     /* Start the VM */
+-    vm_start(this->vm);
++    if (!vm_start(this->vm)) {
++      printerr("Encrypted or faulty DVD");
++      return DVDNAV_STATUS_ERR;
++    }
+     this->started = 1;
+   }
+ 
+@@ -665,16 +665,10 @@
+     fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_wide=%d\n",stream_change->physical_wide);
+     fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_letterbox=%d\n",stream_change->physical_letterbox);
+     fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change->physical_pan_scan);
++    fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning DVDNAV_STATUS_OK\n");
+ #endif
+-    if (stream_change->physical_wide != -1 &&
+-        stream_change->physical_letterbox != -1 &&
+-        stream_change->physical_pan_scan != -1) {
+-#ifdef LOG_DEBUG
+-      fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning DVDNAV_STATUS_OK\n");
+-#endif
+-      pthread_mutex_unlock(&this->vm_lock); 
+-      return DVDNAV_STATUS_OK;
+-    }
++    pthread_mutex_unlock(&this->vm_lock); 
++    return DVDNAV_STATUS_OK;
+   }
+ 
+   /* has the audio channel changed? */  
+diff -Naur libdvdnav-0.1.10-org/src/dvdnav_events.h libdvdnav-0.1.10/src/dvdnav_events.h
+--- libdvdnav-0.1.10-org/src/dvdnav_events.h	2003-04-27 03:26:18.000000000 +0200
++++ libdvdnav-0.1.10/src/dvdnav_events.h	2008-01-23 06:11:52.000000000 +0100
+@@ -16,9 +16,6 @@
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+- *
+- * $Id: dvdnav_events.h,v 1.12 2003/04/27 01:26:18 jcdutton Exp $
+- *
+  */
+ 
+ /*
+diff -Naur libdvdnav-0.1.10-org/src/dvdnav.h libdvdnav-0.1.10/src/dvdnav.h
+--- libdvdnav-0.1.10-org/src/dvdnav.h	2003-06-09 17:17:44.000000000 +0200
++++ libdvdnav-0.1.10/src/dvdnav.h	2008-01-23 06:11:52.000000000 +0100
+@@ -16,9 +16,6 @@
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+- *
+- * $Id: dvdnav.h,v 1.31 2003/06/09 15:17:44 mroi Exp $
+- *
+  */
+ 
+ /*
+@@ -114,6 +111,8 @@
+  */
+ const char* dvdnav_err_to_string(dvdnav_t *self);
+ 
++/* converts a dvd_time_t to PTS ticks */
++int64_t dvdnav_convert_time(dvd_time_t *time);
+ 
+ /*********************************************************************
+  * changing and reading DVD player characteristics                   *
+diff -Naur libdvdnav-0.1.10-org/src/dvdnav_internal.h libdvdnav-0.1.10/src/dvdnav_internal.h
+--- libdvdnav-0.1.10-org/src/dvdnav_internal.h	2004-02-13 20:16:17.000000000 +0100
++++ libdvdnav-0.1.10/src/dvdnav_internal.h	2008-03-28 15:24:50.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* 
+- * Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
++ * Copyright (C) 2001-2004 Rich Wareham <richwareham at users.sourceforge.net>
+  * 
+  * This file is part of libdvdnav, a DVD navigation library.
+  * 
+@@ -16,9 +16,6 @@
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+- *
+- * $Id: dvdnav_internal.h,v 1.12 2004/02/13 19:16:17 mroi Exp $
+- *
+  */
+ 
+ #ifndef DVDNAV_INTERNAL_H_INCLUDED
+@@ -34,6 +31,34 @@
+ #include <limits.h>
+ #include <string.h>
+ 
++#ifndef HAVE_GETTIMEOFDAY
++#  ifdef WIN32
++#    include <winsock.h>
++struct timezone;
++#  else
++#    include <sys/time.h>
++#  endif
++/* replacement gettimeofday implementation */
++#include <sys/timeb.h>
++static inline int dvdnav_private_gettimeofday( struct timeval *tv, void *tz )
++{
++  struct timeb t;
++  ftime( &t );
++  tv->tv_sec = t.time;
++  tv->tv_usec = t.millitm * 1000;
++  return 0;
++}
++#define gettimeofday(TV, TZ) dvdnav_private_gettimeofday((TV), (TZ))
++#define HAVE_GETTIMEOFDAY 1
++#endif
++
++#ifndef HAVE_SNPRINTF
++#  ifdef HAVE__SNPRINTF
++#    define snprintf _snprintf
++#    define HAVE_SNPRINTF 1
++#  endif
++#endif
++
+ #ifdef WIN32
+ 
+ /* pthread_mutex_* wrapper for win32 */
+@@ -45,16 +70,6 @@
+ #define pthread_mutex_unlock(a)  LeaveCriticalSection(a)
+ #define pthread_mutex_destroy(a)
+ 
+-/* replacement gettimeofday implementation */
+-#include <sys/timeb.h>
+-static inline int gettimeofday( struct timeval *tv, void *tz )
+-{
+-  struct timeb t;
+-  ftime( &t );
+-  tv->tv_sec = t.time;
+-  tv->tv_usec = t.millitm * 1000;
+-  return 0;
+-}
+ #include <io.h> /* read() */
+ #define lseek64 _lseeki64
+ 
+@@ -184,15 +199,38 @@
+ 
+ /** USEFUL MACROS **/
+ 
++/* printerr*() are often called when this is NULL. Avoid segfaults by replacing these with
++ * more common prints
++ */
+ #ifdef __GNUC__
+-#define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args);
++#define printerrf(format, args...)					\
++  do {									\
++    if ( ! this ) fprintf(stderr, "Missing 'this' pointer while erroring:" format "\n", ## args); \
++    else snprintf(this->err_str, MAX_ERR_LEN, format, ## args);		\
++  } while(0);
+ #else
+ #ifdef _MSC_VER
+ #define printerrf(str) snprintf(this->err_str, MAX_ERR_LEN, str);
+ #else
+-#define printerrf(...) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__);
++#define printerrf(...)						 \
++  do {								 \
++    if ( ! this ) {						 \
++      fprintf(stderr, "Missing 'this' pointer while erroring:"); \
++      fprintf(stderr, __VA_ARGS__);				 \
++      fprintf(stderr, "\n");					 \
++    } else {							 \
++      snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__);	 \
++    }								 \
++  } while(0);
+ #endif /* WIN32 */
+ #endif
+-#define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN);
++#define printerr(str)							\
++  do {									\
++    if ( ! this ) {							\
++      fprintf(stderr, "Missing 'this' pointer while erroring: %s\n", str); \
++    } else {								\
++      strncpy(this->err_str, str, MAX_ERR_LEN);				\
++    }									\
++  } while(0);
+ 
+ #endif /* DVDNAV_INTERNAL_H_INCLUDED */
+diff -Naur libdvdnav-0.1.10-org/src/dvdread/bswap.h libdvdnav-0.1.10/src/dvdread/bswap.h
+--- libdvdnav-0.1.10-org/src/dvdread/bswap.h	2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav-0.1.10/src/dvdread/bswap.h	2008-01-23 06:11:52.000000000 +0100
+@@ -3,7 +3,7 @@
+ 
+ /*
+  * Copyright (C) 2000, 2001 Billy Biggs <vektor at dumbterm.net>,
+- *                          Håkan Hjort <d95hjort at dtek.chalmers.se>
++ *                          HÃ¥kan Hjort <d95hjort at dtek.chalmers.se>
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+@@ -35,12 +35,24 @@
+ #include <sys/param.h>
+ #endif
+ 
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__GLIBC__)
+ #include <byteswap.h>
+ #define B2N_16(x) x = bswap_16(x)
+ #define B2N_32(x) x = bswap_32(x)
+ #define B2N_64(x) x = bswap_64(x)
+ 
++#elif defined(__SVR4) && defined(__sun)
++#include <sys/byteorder.h>
++#define B2N_16(x) x = BSWAP_16(x)
++#define B2N_32(x) x = BSWAP_32(x)
++#define B2N_64(x) x = BSWAP_64(x)
++
++#elif defined(__APPLE__)
++#include <libkern/OSByteOrder.h>
++#define B2N_16(x) x = OSSwapBigToHostInt16(x)
++#define B2N_32(x) x = OSSwapBigToHostInt32(x)
++#define B2N_64(x) x = OSSwapBigToHostInt64(x)
++
+ #elif defined(__NetBSD__)
+ #include <sys/endian.h>
+ #define B2N_16(x) BE16TOH(x)
+@@ -61,11 +73,11 @@
+ 
+ /* This is a slow but portable implementation, it has multiple evaluation 
+  * problems so beware.
+- * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such 
++ * Old FreeBSD and Windows don't have <byteswap.h> or any other such 
+  * functionality! 
+  */
+ 
+-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__)
++#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__)
+ #define B2N_16(x) \
+  x = ((((x) & 0xff00) >> 8) | \
+       (((x) & 0x00ff) << 8))
+diff -Naur libdvdnav-0.1.10-org/src/dvdread/dvd_input.c libdvdnav-0.1.10/src/dvdread/dvd_input.c
+--- libdvdnav-0.1.10-org/src/dvdread/dvd_input.c	2004-04-09 14:15:26.000000000 +0200
++++ libdvdnav-0.1.10/src/dvdread/dvd_input.c	2008-01-23 06:11:52.000000000 +0100
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (C) 2002 Samuel Hocevar <sam at zoy.org>,
+- *                    Håkan Hjort <d95hjort at dtek.chalmers.se>
++ *                    HÃ¥kan Hjort <d95hjort at dtek.chalmers.se>
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+@@ -35,6 +35,7 @@
+ int         (*dvdinput_title) (dvd_input_t, int); 
+ int         (*dvdinput_read)  (dvd_input_t, void *, int, int);
+ char *      (*dvdinput_error) (dvd_input_t);
++int         (*dvdinput_is_encrypted) (dvd_input_t);
+ 
+ #ifdef HAVE_DVDCSS_DVDCSS_H
+ /* linking to libdvdcss */
+@@ -55,6 +56,73 @@
+ #include "../../msvc/contrib/dlfcn.c"
+ #endif
+ 
++/* Copied from css.h */
++#define KEY_SIZE 5
++
++typedef uint8_t dvd_key_t[KEY_SIZE];
++
++typedef struct dvd_title_s
++{
++    int                 i_startlb;
++    dvd_key_t           p_key;
++    struct dvd_title_s *p_next;
++} dvd_title_t;
++
++typedef struct css_s
++{
++    int             i_agid;      /* Current Authenication Grant ID. */
++    dvd_key_t       p_bus_key;   /* Current session key. */
++    dvd_key_t       p_disc_key;  /* This DVD disc's key. */
++    dvd_key_t       p_title_key; /* Current title key. */
++} css_t;
++
++/* Copied from libdvdcss.h */
++
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
++struct dvdcss_s
++{
++    /* File descriptor */
++    char * psz_device;
++    int    i_fd;
++    int    i_read_fd;
++    int    i_pos;
++
++    /* File handling */
++    void *pf_seek;
++    void *pf_read;
++    void *pf_readv;
++
++    /* Decryption stuff */
++    int          i_method;
++    css_t        css;
++    int          b_ioctls;
++    int          b_scrambled;
++    dvd_title_t *p_titles;
++
++    /* Key cache directory and pointer to the filename */
++    char   psz_cachefile[PATH_MAX];
++    char * psz_block;
++
++    /* Error management */
++    char * psz_error;
++    int    b_errors;
++    int    b_debug;
++
++#ifdef WIN32
++    int    b_file;
++    char * p_readv_buffer;
++    int    i_readv_buf_size;
++#endif
++
++#ifndef WIN32
++    int    i_raw_fd;
++#endif
++};
++
++
+ typedef struct dvdcss_s *dvdcss_handle;
+ static dvdcss_handle (*DVDcss_open)  (const char *);
+ static int           (*DVDcss_close) (dvdcss_handle);
+@@ -149,8 +217,13 @@
+   return 0;
+ }
+ 
+-
+-
++static int css_is_encrypted (dvd_input_t dev)
++{
++  if (dev->dvdcss == NULL) {
++    return 0;
++  }
++  return dev->dvdcss->b_scrambled;
++}
+ 
+ 
+ 
+@@ -269,6 +342,10 @@
+   return 0;
+ }
+ 
++static int file_is_encrypted (dvd_input_t dev)
++{
++  return 0;
++}
+ 
+ /**
+  * Setup read functions with either libdvdcss or minimal DVD access.
+@@ -287,10 +364,12 @@
+ #else
+   /* dlopening libdvdcss */
+ 
+-#ifndef WIN32
+-  dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
+-#else
++#ifdef HOST_OS_DARWIN
++  dvdcss_library = dlopen("libdvdcss.2.dylib", RTLD_LAZY);
++#elif defined(WIN32)
+   dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY);
++#else
++  dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
+ #endif
+ 
+   if(dvdcss_library != NULL) {
+@@ -323,7 +402,7 @@
+       dvdcss_library = NULL;
+     } else if(!DVDcss_open  || !DVDcss_close || !DVDcss_title || !DVDcss_seek
+ 	      || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
+-      fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss.so.2, "
++      fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss, "
+ 	      "this shouldn't happen !\n");
+       dlclose(dvdcss_library);
+     }
+@@ -347,6 +426,7 @@
+     dvdinput_title = css_title;
+     dvdinput_read  = css_read;
+     dvdinput_error = css_error;
++    dvdinput_is_encrypted = css_is_encrypted;
+     return 1;
+     
+   } else {
+@@ -359,6 +439,7 @@
+     dvdinput_title = file_title;
+     dvdinput_read  = file_read;
+     dvdinput_error = file_error;
++    dvdinput_is_encrypted = file_is_encrypted;
+     return 0;
+   }
+ }
+diff -Naur libdvdnav-0.1.10-org/src/dvdread/dvd_input.h libdvdnav-0.1.10/src/dvdread/dvd_input.h
+--- libdvdnav-0.1.10-org/src/dvdread/dvd_input.h	2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav-0.1.10/src/dvdread/dvd_input.h	2008-01-23 06:11:52.000000000 +0100
+@@ -3,7 +3,7 @@
+ 
+ /*
+  * Copyright (C) 2001, 2002 Samuel Hocevar <sam at zoy.org>,
+- *                     %s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list