diff options
Diffstat (limited to 'stream')
-rw-r--r-- | stream/cdinfo.c | 2 | ||||
-rw-r--r-- | stream/stream_dvd.c | 12 | ||||
-rw-r--r-- | stream/stream_dvd.h | 7 | ||||
-rw-r--r-- | stream/stream_dvd_common.c | 4 | ||||
-rw-r--r-- | stream/stream_dvd_common.h | 4 |
5 files changed, 12 insertions, 17 deletions
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)); 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; 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 <stdint.h> -#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 <dvdread/dvd_reader.h> #include <dvdread/ifo_types.h> #include <dvdread/ifo_read.h> #include <dvdread/nav_read.h> -#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 <inttypes.h> -#ifdef CONFIG_DVDREAD_INTERNAL -#include "libdvdread/ifo_types.h" -#else #include <dvdread/ifo_types.h> -#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 <inttypes.h> -#ifdef CONFIG_DVDREAD_INTERNAL -#include "libdvdread/ifo_types.h" -#else #include <dvdread/ifo_types.h> -#endif int mp_dvdtimetomsec(dvd_time_t *dt); |