vlc | branch: master | Petri Hintukainen <phint...@gmail.com> | Sun Dec 20 12:04:07 2015 +0200| [35396aee0eb6eb7a4529bc8bb42ab5908df9c23c] | committer: Jean-Baptiste Kempf
dvdnav: improve stream probing First sectors of DVD are filled with zeros. Checking boot sector avoids seeking when probing "regular" media files. Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=35396aee0eb6eb7a4529bc8bb42ab5908df9c23c --- modules/access/dvdnav.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c index 270007d..2422e39 100644 --- a/modules/access/dvdnav.c +++ b/modules/access/dvdnav.c @@ -403,6 +403,19 @@ bailout: *****************************************************************************/ static int StreamProbeDVD( stream_t *s ) { + /* first sector should be filled with zeros */ + size_t i_peek; + const uint8_t *p_peek; + i_peek = stream_Peek( s, &p_peek, 2048 ); + if( i_peek < 512 ) { + return VLC_EGENERIC; + } + while (i_peek > 0) { + if (p_peek[ --i_peek ]) { + return VLC_EGENERIC; + } + } + /* ISO 9660 volume descriptor */ char iso_dsc[6]; if( stream_Seek( s, 0x8000 + 1 ) != VLC_SUCCESS _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits