wok-current rev 10162

Up: libdvdread to 4.1.3.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri May 20 20:11:13 2011 +0000 (2011-05-20)
parents 6e625669569e
children 33864a14f229
files libdvdread-dev/receipt libdvdread/receipt libdvdread/stuff/DVDFileStat.patch
line diff
     1.1 --- a/libdvdread-dev/receipt	Fri May 20 19:45:25 2011 +0000
     1.2 +++ b/libdvdread-dev/receipt	Fri May 20 20:11:13 2011 +0000
     1.3 @@ -1,13 +1,13 @@
     1.4  # SliTaz package receipt."
     1.5  
     1.6  PACKAGE="libdvdread-dev"
     1.7 -VERSION="0.9.7"
     1.8 +VERSION="4.1.3"
     1.9  CATEGORY="system-tools"
    1.10  SHORT_DESC="Librairy for reading DVDs dev files."
    1.11  MAINTAINER="erjo@slitaz.org"
    1.12  WANTED="libdvdread"
    1.13  DEPENDS="libdvdread"
    1.14 -WEB_SITE="http://www.dtek.chalmers.se/groups/dvd/"
    1.15 +WEB_SITE="http://www.mplayerhq.hu/MPlayer/releases/dvdnav/"
    1.16  
    1.17  genpkg_rules()
    1.18  {
    1.19 @@ -17,11 +17,16 @@
    1.20  	if [ -d "$_pkg/usr/include" ]; then
    1.21  		cp -a $_pkg/usr/include $fs/usr
    1.22  	fi
    1.23 -	
    1.24 +
    1.25 +	# Copying bin dir if existes
    1.26 +	if [ -d "$_pkg/usr/bin" ]; then
    1.27 +		cp -a $_pkg/usr/bin $fs/usr
    1.28 +	fi
    1.29 +
    1.30  	# Copying pkgconfig dir if existes
    1.31  	if [ -d "$_pkg/usr/lib/pkgconfig" ]; then
    1.32  		test -d $_pkg/usr/lib/ || mkdir -p $_pkg/usr/lib/
    1.33 -		cp -a $_pkg/usr/lib/pkgconfig $fs/usr/usr/lib
    1.34 +		cp -a $_pkg/usr/lib/pkgconfig $fs/usr/lib
    1.35  	fi
    1.36  	
    1.37  	# Copying static libs if existes
     2.1 --- a/libdvdread/receipt	Fri May 20 19:45:25 2011 +0000
     2.2 +++ b/libdvdread/receipt	Fri May 20 20:11:13 2011 +0000
     2.3 @@ -1,22 +1,21 @@
     2.4  # SliTaz package receipt.
     2.5  
     2.6  PACKAGE="libdvdread"
     2.7 -VERSION="0.9.7"
     2.8 +VERSION="4.1.3"
     2.9  CATEGORY="system-tools"
    2.10  SHORT_DESC="Librairy for reading DVDs"
    2.11  MAINTAINER="erjo@slitaz.org"
    2.12 -DEPENDS=""
    2.13 +BUILD_DEPENDS="libdvdcss-dev"
    2.14  TARBALL="$PACKAGE-$VERSION.tar.gz"
    2.15 -WEB_SITE="http://www.dtek.chalmers.se/groups/dvd/"
    2.16 -WGET_URL="http://www.dtek.chalmers.se/groups/dvd/dist/$TARBALL"
    2.17 +WEB_SITE="http://www.mplayerhq.hu/MPlayer/releases/dvdnav/"
    2.18 +WGET_URL="${WEB_SITE}${TARBALL}"
    2.19  
    2.20  # Rules to configure and make the package.
    2.21  compile_rules()
    2.22  {
    2.23  	cd $src
    2.24 -	./configure --prefix=/usr  $CONFIGURE_ARGS
    2.25 -	make
    2.26 -	make DESTDIR=$PWD/_pkg install
    2.27 +	patch -Np1 -i $stuff/DVDFileStat.patch
    2.28 +	./autogen.sh && make && make install
    2.29  }
    2.30  
    2.31  # Rules to gen a SliTaz package suitable for Tazpkg.
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/libdvdread/stuff/DVDFileStat.patch	Fri May 20 20:11:13 2011 +0000
     3.3 @@ -0,0 +1,237 @@
     3.4 +diff -pruN libdvdread-4.1.3/src/dvd_reader.c libdvdread-4.1.3.new/src/dvd_reader.c
     3.5 +--- libdvdread-4.1.3/src/dvd_reader.c	2008-09-06 23:55:51.000000000 +0200
     3.6 ++++ libdvdread-4.1.3.new/src/dvd_reader.c	2009-02-28 01:36:20.000000000 +0100
     3.7 +@@ -889,6 +889,187 @@ void DVDCloseFile( dvd_file_t *dvd_file 
     3.8 +     }
     3.9 + }
    3.10 + 
    3.11 ++static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title, 
    3.12 ++                             int menu, dvd_stat_t *statbuf)
    3.13 ++{
    3.14 ++  char filename[ MAX_UDF_FILE_NAME_LEN ];
    3.15 ++  uint32_t size;
    3.16 ++  off_t tot_size;
    3.17 ++  off_t parts_size[9];
    3.18 ++  int nr_parts = 0;
    3.19 ++  int n;
    3.20 ++ 
    3.21 ++  if( title == 0 ) {
    3.22 ++    sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
    3.23 ++  } else {
    3.24 ++    sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
    3.25 ++  }
    3.26 ++  if(!UDFFindFile( dvd, filename, &size )) {
    3.27 ++    return -1;
    3.28 ++  }
    3.29 ++  tot_size = size;
    3.30 ++  nr_parts = 1;
    3.31 ++  parts_size[0] = size;
    3.32 ++
    3.33 ++  if( !menu ) {
    3.34 ++    int cur;
    3.35 ++
    3.36 ++    for( cur = 2; cur < 10; cur++ ) {
    3.37 ++      sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
    3.38 ++      if( !UDFFindFile( dvd, filename, &size ) ) {
    3.39 ++        break;
    3.40 ++      }
    3.41 ++      parts_size[nr_parts] = size;
    3.42 ++      tot_size += size;
    3.43 ++      nr_parts++;
    3.44 ++    }
    3.45 ++  }
    3.46 ++  
    3.47 ++  statbuf->size = tot_size;
    3.48 ++  statbuf->nr_parts = nr_parts;
    3.49 ++  for(n = 0; n < nr_parts; n++) {
    3.50 ++    statbuf->parts_size[n] = parts_size[n];
    3.51 ++  }
    3.52 ++  return 0;
    3.53 ++}
    3.54 ++
    3.55 ++
    3.56 ++static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
    3.57 ++                                       int menu, dvd_stat_t *statbuf )
    3.58 ++{
    3.59 ++  char filename[ MAX_UDF_FILE_NAME_LEN ];
    3.60 ++  char full_path[ PATH_MAX + 1 ];
    3.61 ++  struct stat fileinfo;
    3.62 ++  off_t tot_size;
    3.63 ++  off_t parts_size[9];
    3.64 ++  int nr_parts = 0;
    3.65 ++  int n;
    3.66 ++
    3.67 ++ 
    3.68 ++    
    3.69 ++  if( title == 0 ) {
    3.70 ++    sprintf( filename, "VIDEO_TS.VOB" );
    3.71 ++  } else {
    3.72 ++    sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
    3.73 ++  }
    3.74 ++  if( !findDVDFile( dvd, filename, full_path ) ) {
    3.75 ++    return -1;
    3.76 ++  }
    3.77 ++  
    3.78 ++  if( stat( full_path, &fileinfo ) < 0 ) {
    3.79 ++    fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
    3.80 ++    return -1;
    3.81 ++  }
    3.82 ++  
    3.83 ++
    3.84 ++  tot_size = fileinfo.st_size;
    3.85 ++  nr_parts = 1;
    3.86 ++  parts_size[0] = fileinfo.st_size;
    3.87 ++
    3.88 ++  if( !menu ) {
    3.89 ++    int cur;
    3.90 ++    
    3.91 ++    for( cur = 2; cur < 10; cur++ ) {
    3.92 ++
    3.93 ++      sprintf( filename, "VTS_%02d_%d.VOB", title, cur );
    3.94 ++      if( !findDVDFile( dvd, filename, full_path ) ) {
    3.95 ++        break;
    3.96 ++      }
    3.97 ++
    3.98 ++      if( stat( full_path, &fileinfo ) < 0 ) {
    3.99 ++        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
   3.100 ++        break;
   3.101 ++      }
   3.102 ++      
   3.103 ++      parts_size[nr_parts] = fileinfo.st_size;
   3.104 ++      tot_size += parts_size[nr_parts];
   3.105 ++      nr_parts++;
   3.106 ++    }
   3.107 ++  }
   3.108 ++
   3.109 ++  statbuf->size = tot_size;
   3.110 ++  statbuf->nr_parts = nr_parts;
   3.111 ++  for(n = 0; n < nr_parts; n++) {
   3.112 ++    statbuf->parts_size[n] = parts_size[n];
   3.113 ++  }
   3.114 ++  return 0;
   3.115 ++}
   3.116 ++
   3.117 ++
   3.118 ++int DVDFileStat(dvd_reader_t *dvd, int titlenum, 
   3.119 ++                dvd_read_domain_t domain, dvd_stat_t *statbuf)
   3.120 ++{
   3.121 ++  char filename[ MAX_UDF_FILE_NAME_LEN ];
   3.122 ++  char full_path[ PATH_MAX + 1 ];
   3.123 ++  struct stat fileinfo;
   3.124 ++  uint32_t size;
   3.125 ++
   3.126 ++  /* Check arguments. */
   3.127 ++  if( dvd == NULL || titlenum < 0 ) {
   3.128 ++    errno = EINVAL;
   3.129 ++    return -1;
   3.130 ++  }
   3.131 ++
   3.132 ++  switch( domain ) {
   3.133 ++  case DVD_READ_INFO_FILE:
   3.134 ++    if( titlenum == 0 ) {
   3.135 ++      sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
   3.136 ++    } else {
   3.137 ++      sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
   3.138 ++    }
   3.139 ++    break;
   3.140 ++  case DVD_READ_INFO_BACKUP_FILE:
   3.141 ++    if( titlenum == 0 ) {
   3.142 ++      sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
   3.143 ++    } else {
   3.144 ++      sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
   3.145 ++    }
   3.146 ++    break;
   3.147 ++  case DVD_READ_MENU_VOBS:
   3.148 ++    if( dvd->isImageFile ) {
   3.149 ++      return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf );
   3.150 ++    } else {
   3.151 ++      return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf );
   3.152 ++    }
   3.153 ++    break;
   3.154 ++  case DVD_READ_TITLE_VOBS:
   3.155 ++    if( titlenum == 0 ) {
   3.156 ++      return -1;
   3.157 ++    }
   3.158 ++    if( dvd->isImageFile ) {
   3.159 ++      return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf );
   3.160 ++    } else {
   3.161 ++      return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf );
   3.162 ++    }
   3.163 ++    break;
   3.164 ++  default:
   3.165 ++    fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" );
   3.166 ++    errno = EINVAL;
   3.167 ++    return -1;
   3.168 ++  }
   3.169 ++  
   3.170 ++  if( dvd->isImageFile ) {
   3.171 ++    if( UDFFindFile( dvd, filename, &size ) ) {
   3.172 ++      statbuf->size = size;
   3.173 ++      statbuf->nr_parts = 1;
   3.174 ++      statbuf->parts_size[0] = size;
   3.175 ++      return 0;
   3.176 ++    }
   3.177 ++  } else {
   3.178 ++    if( findDVDFile( dvd, filename, full_path ) )  {
   3.179 ++      if( stat( full_path, &fileinfo ) < 0 ) {
   3.180 ++        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
   3.181 ++      } else {
   3.182 ++        statbuf->size = fileinfo.st_size;
   3.183 ++        statbuf->nr_parts = 1;
   3.184 ++        statbuf->parts_size[0] = statbuf->size;
   3.185 ++        return 0;
   3.186 ++      }
   3.187 ++    }
   3.188 ++  }
   3.189 ++  return -1;
   3.190 ++}
   3.191 ++
   3.192 + /* Internal, but used from dvd_udf.c */
   3.193 + int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
   3.194 + 			 size_t block_count, unsigned char *data,
   3.195 +diff -pruN libdvdread-4.1.3/src/dvd_reader.h libdvdread-4.1.3.new/src/dvd_reader.h
   3.196 +--- libdvdread-4.1.3/src/dvd_reader.h	2008-09-06 23:55:51.000000000 +0200
   3.197 ++++ libdvdread-4.1.3.new/src/dvd_reader.h	2009-02-28 01:36:49.000000000 +0100
   3.198 +@@ -115,6 +115,42 @@ typedef enum {
   3.199 + } dvd_read_domain_t;
   3.200 + 
   3.201 + /**
   3.202 ++ *
   3.203 ++ */
   3.204 ++typedef struct {
   3.205 ++  off_t size;          /**< Total size of file in bytes */
   3.206 ++  int nr_parts;        /**< Number of file parts */
   3.207 ++  off_t parts_size[9]; /**< Size of each part in bytes */
   3.208 ++} dvd_stat_t;
   3.209 ++
   3.210 ++/**
   3.211 ++ * Stats a file on the DVD given the title number and domain.
   3.212 ++ * The information about the file is stored in a dvd_stat_t
   3.213 ++ * which contains information about the size of the file and
   3.214 ++ * the number of parts in case of a multipart file and the respective
   3.215 ++ * sizes of the parts.
   3.216 ++ * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB
   3.217 ++ * The size of VTS_02_1.VOB will be stored in stat->parts_size[0],
   3.218 ++ * VTS_02_2.VOB in stat->parts_size[1], ...
   3.219 ++ * The total size (sum of all parts) is stored in stat->size and
   3.220 ++ * stat->nr_parts will hold the number of parts.
   3.221 ++ * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files.
   3.222 ++ * 
   3.223 ++ * This function is only of use if you want to get the size of each file
   3.224 ++ * in the filesystem. These sizes are not needed to use any other
   3.225 ++ * functions in libdvdread. 
   3.226 ++ *
   3.227 ++ * @param dvd  A dvd read handle.
   3.228 ++ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
   3.229 ++ * @param domain Which domain. 
   3.230 ++ * @param stat Pointer to where the result is stored.
   3.231 ++ * @return If successful 0, otherwise -1.
   3.232 ++ *
   3.233 ++ * int DVDFileStat(dvd, titlenum, domain, stat);
   3.234 ++ */
   3.235 ++int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *);
   3.236 ++  
   3.237 ++/**
   3.238 +  * Opens a file on the DVD given the title number and domain.
   3.239 +  *
   3.240 +  * If the title number is 0, the video manager information is opened