From: Reinhard T. <sir...@ta...> - 2008-01-30 19:18:01
|
forwarded 463177 xin...@li... stop ja...@go... (Jan Echternach) writes: > On Wed, Jan 30, 2008 at 07:27:24AM +0100, Reinhard Tartler wrote: >> This patch is currently being discussed upstream: >> >> http://thread.gmane.org/gmane.comp.video.xine.devel/17764 > > The patch discussed in that thread does not seem to have anything in > common with 03-udf.dpatch in libdvdread-0.9.7-6. 03-udf.dpatch does > not look like an ugly hack, and does not even touch the same files. I see. I'm CC'ing the xine-developers with this email. The patch in question can be found here: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=diff;att=1;bug=460400 Inline here: --- orig/libdvdread-0.9.7/dvdread/dvd_reader.c 2006-10-06 09:58:03.000000000 +0200 +++ libdvdread-0.9.7/dvdread/dvd_reader.c 2008-01-12 11:39:23.000000000 +0100 @@ -1393,6 +1393,24 @@ return offset; } +int DVDFileSeekForce( dvd_file_t *dvd_file, int offset, int force_size ) +{ + /* Check arguments. */ + if( dvd_file == NULL || offset < 0 ) + return -1; + + if( dvd_file->filesize < force_size) { + dvd_file->filesize = force_size; + fprintf(stderr, "libdvdread: Ignored UDF provided size of file.\n"); + } + + if( offset > dvd_file->filesize * DVD_VIDEO_LB_LEN ) { + return -1; + } + dvd_file->seek_pos = (uint32_t) offset; + return offset; +} + #ifndef HAVE_UINTPTR_T #warning "Assuming that (unsigned long) can hold (void *)" typedef unsigned long uintptr_t; diff -ur orig/libdvdread-0.9.7/dvdread/dvd_reader.h libdvdread-0.9.7/dvdread/dvd_reader.h --- orig/libdvdread-0.9.7/dvdread/dvd_reader.h 2006-10-06 10:12:31.000000000 +0200 +++ libdvdread-0.9.7/dvdread/dvd_reader.h 2008-01-12 11:37:16.000000000 +0100 @@ -240,6 +240,8 @@ */ int DVDFileSeek( dvd_file_t *, int ); +int DVDFileSeekForce( dvd_file_t *, int, int ); + /** * Reads the given number of bytes from the file. This call can only be used * on the information files, and may not be used for reading from a VOB. This diff -ur orig/libdvdread-0.9.7/dvdread/ifo_read.c libdvdread-0.9.7/dvdread/ifo_read.c --- orig/libdvdread-0.9.7/dvdread/ifo_read.c 2006-01-22 13:19:19.000000000 +0100 +++ libdvdread-0.9.7/dvdread/ifo_read.c 2008-01-12 11:39:40.000000000 +0100 @@ -106,6 +106,10 @@ return (DVDFileSeek(dvd_file, (int)offset) == (int)offset); } +static inline int DVDFileSeekForce_( dvd_file_t *dvd_file, uint32_t offset, int force_size ) { + return (DVDFileSeekForce(dvd_file, (int)offset, force_size) == (int)offset); +} + ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) { ifo_handle_t *ifofile; @@ -1659,7 +1664,7 @@ unsigned int i; int info_length; - if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) + if(!DVDFileSeekForce_(ifofile->file, sector * DVD_BLOCK_LEN, sector)) return 0; if(!(DVDReadBytes(ifofile->file, vobu_admap, VOBU_ADMAP_SIZE))) Is this patch acceptable for xine 1.1? If not, what about 1.2? -- Gruesse/greetings, Reinhard Tartler, KeyID 945348A4 |