summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 05:07:09 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 05:57:31 +0200
commit9bcd12fdf5c6f85e9bb391caa2713021624a957e (patch)
tree375eac533ead90a45e7121e5ab307861b4ef52c8 /stream
parentd419ecd161634e79dab3ac57d57c4bccba2adcdc (diff)
parente0d66b140e1da7a793bff15003cadab79544b1dd (diff)
downloadmpv-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')
-rw-r--r--stream/cdinfo.c2
-rw-r--r--stream/stream_dvd.c12
-rw-r--r--stream/stream_dvd.h7
-rw-r--r--stream/stream_dvd_common.c4
-rw-r--r--stream/stream_dvd_common.h4
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);