diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-01-15 05:07:09 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-01-15 05:57:31 +0200 |
commit | 9bcd12fdf5c6f85e9bb391caa2713021624a957e (patch) | |
tree | 375eac533ead90a45e7121e5ab307861b4ef52c8 /stream/stream_dvd.c | |
parent | d419ecd161634e79dab3ac57d57c4bccba2adcdc (diff) | |
parent | e0d66b140e1da7a793bff15003cadab79544b1dd (diff) | |
download | mpv-9bcd12fdf5c6f85e9bb391caa2713021624a957e.tar.bz2 mpv-9bcd12fdf5c6f85e9bb391caa2713021624a957e.tar.xz |
Merge svn changes up to r28310
The libdvdread4 and libdvdnav directories, which are externals in the
svn repository, are at least for now not included in any form. I added
configure checks to automatically disable internal libdvdread and
libdvdnav if the corresponding directories are not present; if they're
added manually then things work the same as in svn.
Diffstat (limited to 'stream/stream_dvd.c')
-rw-r--r-- | stream/stream_dvd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 20cc8431f0..05f9c411ab 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -364,7 +364,8 @@ read_next: } len = DVDReadBlocks(d->title, d->cur_pack, 1, data); - if(!len) return -1; //error + // only == 0 should indicate an error, but some dvdread version are buggy when used with dvdcss + if(len <= 0) return -1; //error if(data[38]==0 && data[39]==0 && data[40]==1 && data[41]==0xBF && data[1024]==0 && data[1025]==0 && data[1026]==1 && data[1027]==0xBF) { @@ -569,6 +570,15 @@ static int seek_to_chapter(stream_t *stream, ifo_handle_t *vts_file, tt_srpt_t * if(!vts_file || !tt_srpt) return 0; + if(title_no < 0 || title_no >= tt_srpt->nr_of_srpts) + return 0; + + // map global title to vts title + title_no = tt_srpt->title[title_no].vts_ttn - 1; + + if(title_no < 0 || title_no >= vts_file->vts_ptt_srpt->nr_of_srpts) + return 0; + if(chapter < 0 || chapter > vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts-1) //no such chapter return 0; |