Commit 35396aee authored by Petri Hintukainen's avatar Petri Hintukainen Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a527e9d0
...@@ -403,6 +403,19 @@ bailout: ...@@ -403,6 +403,19 @@ bailout:
*****************************************************************************/ *****************************************************************************/
static int StreamProbeDVD( stream_t *s ) 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 */ /* ISO 9660 volume descriptor */
char iso_dsc[6]; char iso_dsc[6];
if( stream_Seek( s, 0x8000 + 1 ) != VLC_SUCCESS if( stream_Seek( s, 0x8000 + 1 ) != VLC_SUCCESS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment