summaryrefslogtreecommitdiff
path: root/src/input/libdvdnav/ifo_read.c
diff options
context:
space:
mode:
authorBastian Blank <waldi@debian.org>2008-03-02 22:48:39 +0000
committerBastian Blank <waldi@debian.org>2008-03-02 22:48:39 +0000
commit431033df2571df5bdd1ec1253cf04921b6d01368 (patch)
tree020cd673ba4cbb87c0784f53c3ed0bcd787546e6 /src/input/libdvdnav/ifo_read.c
parentbfcacf9ccf8331baf47a7db55017d0ca5e273080 (diff)
downloadxine-lib-431033df2571df5bdd1ec1253cf04921b6d01368.tar.gz
xine-lib-431033df2571df5bdd1ec1253cf04921b6d01368.tar.bz2
libdvdread - Uses UDF provided length as authoritative
libdvdread uses the file length provided by the UDF fs of the title set IFO files authoritative. I got a DVD which have parts of this file mapped outside of the provided file size and according to my memory only the offsets in the files matters in the standard. This patch adjusts the internal knowledge of the filesize accordingly and at least allows mplayer to play the dvd. (Imported from Debian libdvdread 0.9.7-8)
Diffstat (limited to 'src/input/libdvdnav/ifo_read.c')
-rw-r--r--src/input/libdvdnav/ifo_read.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/input/libdvdnav/ifo_read.c b/src/input/libdvdnav/ifo_read.c
index 8f47d2a54..bc1ba580b 100644
--- a/src/input/libdvdnav/ifo_read.c
+++ b/src/input/libdvdnav/ifo_read.c
@@ -93,6 +93,10 @@ static inline int DVDFileSeek_( dvd_file_t *dvd_file, uint32_t offset ) {
return (DVDFileSeek(dvd_file, (int)offset) == (int)offset);
}
+static inline int32_t 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;
@@ -1507,7 +1511,7 @@ static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
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)))