From d191de856486174faec188ad142ef3ff1b347bd4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 25 Sep 2014 23:38:23 +0200 Subject: stream_dvd: better .ifo probing stream_dvd.c includes a pseudo-protocol that recognizes .IFO files, and plays them using libdvdread. This was relatively lazy, and could perhaps easily trigger with files that just had the .ifo extension. Make the checks stricter, and even probe the file header. Apparently the first bytes in an .ifo file are always "DVDVIDEO-VTS", so check for this. Refuse to load the main "video_ts.ifo". The plan is to use stream_dvdnav for it. This also removes at least 1 memory leak. --- stream/stream_dvd_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stream/stream_dvd_common.h') diff --git a/stream/stream_dvd_common.h b/stream/stream_dvd_common.h index a2b05e8b77..96dfbb3cb3 100644 --- a/stream/stream_dvd_common.h +++ b/stream/stream_dvd_common.h @@ -20,7 +20,7 @@ #define MPLAYER_STREAM_DVD_COMMON_H #include -#include +#include #include "stream.h" extern const char * const dvd_audio_stream_channels[6]; @@ -29,4 +29,6 @@ extern const char * const dvd_audio_stream_types[8]; void dvd_set_speed(stream_t *stream, char *device, unsigned speed); int mp_dvdtimetomsec(dvd_time_t *dt); +int dvd_probe(const char *path, const char *ext, const char *sig); + #endif /* MPLAYER_STREAM_DVD_COMMON_H */ -- cgit v1.2.3