From a2c2268cdf6a2c5140084d61000144123f325ee3 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 31 Dec 2008 14:21:50 +0000 Subject: Work around a dvdread bug where DVDReadBlocks would return values < 0 on read error, causing hangs e.g. when seeking to the very last chapter (which would read beyond the size of the DVD). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28216 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index ec0b7983c8..235586597a 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) { -- cgit v1.2.3 From 82d097d04bf08ec28444709569f6d65347d2ac0f Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 1 Jan 2009 11:46:34 +0000 Subject: Fix DVD seek_to_chapter: the title number must be converted to a per-VTS title number first. Also add a few out-of-bounds checks just in case. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28226 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'stream') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 235586597a..ae07239ad5 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -570,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; -- cgit v1.2.3 From 824abb5a65c1de35259818956e22a24c33f318b4 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 5 Jan 2009 14:48:03 +0000 Subject: Add missing 'void' keyword to parameterless function declarations. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28267 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/cdinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/cdinfo.c b/stream/cdinfo.c index c3874771aa..4f576c98b9 100644 --- a/stream/cdinfo.c +++ b/stream/cdinfo.c @@ -20,7 +20,7 @@ *******************************************************************************************************************/ cd_info_t* -cd_info_new() { +cd_info_new(void) { cd_info_t *cd_info = NULL; cd_info = malloc(sizeof(cd_info_t)); -- cgit v1.2.3 From 4af9bf7e02295e001a0a1b16ac77d63d543f1bb6 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 8 Jan 2009 19:28:28 +0000 Subject: Switch internal dvdread to libdvdread SVN external. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28280 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.h | 7 ------- stream/stream_dvd_common.c | 4 ---- stream/stream_dvd_common.h | 4 ---- 3 files changed, 15 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvd.h b/stream/stream_dvd.h index 9196ef04e0..effd5b3d67 100644 --- a/stream/stream_dvd.h +++ b/stream/stream_dvd.h @@ -3,17 +3,10 @@ #include "config.h" #include -#ifdef CONFIG_DVDREAD_INTERNAL -#include "libdvdread/dvd_reader.h" -#include "libdvdread/ifo_types.h" -#include "libdvdread/ifo_read.h" -#include "libdvdread/nav_read.h" -#else #include #include #include #include -#endif #include "stream.h" typedef struct { diff --git a/stream/stream_dvd_common.c b/stream/stream_dvd_common.c index e2cf3690ba..55bee132b7 100644 --- a/stream/stream_dvd_common.c +++ b/stream/stream_dvd_common.c @@ -1,10 +1,6 @@ #include "config.h" #include -#ifdef CONFIG_DVDREAD_INTERNAL -#include "libdvdread/ifo_types.h" -#else #include -#endif #include "stream_dvd_common.h" /** diff --git a/stream/stream_dvd_common.h b/stream/stream_dvd_common.h index c79492e061..906ae02ba6 100644 --- a/stream/stream_dvd_common.h +++ b/stream/stream_dvd_common.h @@ -3,11 +3,7 @@ #include "config.h" #include -#ifdef CONFIG_DVDREAD_INTERNAL -#include "libdvdread/ifo_types.h" -#else #include -#endif int mp_dvdtimetomsec(dvd_time_t *dt); -- cgit v1.2.3