Commit 5482c8f8 authored by Dennis van Amerongen's avatar Dennis van Amerongen

* modules/demux/ogg.c: backport [24258] fix for demuxing Ogg with skeleton...

* modules/demux/ogg.c: backport [24258] fix for demuxing Ogg with skeleton track. As noted in #1412 all content in Ogg now require a skeleton track..
parent 31b94221
...@@ -277,14 +277,14 @@ static int Demux( demux_t * p_demux ) ...@@ -277,14 +277,14 @@ static int Demux( demux_t * p_demux )
{ {
if( p_stream->fmt.i_codec == VLC_FOURCC('t','h','e','o') && if( p_stream->fmt.i_codec == VLC_FOURCC('t','h','e','o') &&
oggpacket.bytes >= 7 && oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[1], "theora", 6 ) ) ! memcmp( oggpacket.packet, "\x80theora", 6 ) )
{ {
Ogg_ReadTheoraHeader( p_stream, &oggpacket ); Ogg_ReadTheoraHeader( p_stream, &oggpacket );
p_stream->secondary_header_packets = 0; p_stream->secondary_header_packets = 0;
} }
else if( p_stream->fmt.i_codec == VLC_FOURCC('v','o','r','b') && else if( p_stream->fmt.i_codec == VLC_FOURCC('v','o','r','b') &&
oggpacket.bytes >= 7 && oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[1], "vorbis", 6 ) ) ! memcmp( oggpacket.packet, "\x01vorbis", 6 ) )
{ {
Ogg_ReadVorbisHeader( p_stream, &oggpacket ); Ogg_ReadVorbisHeader( p_stream, &oggpacket );
p_stream->secondary_header_packets = 0; p_stream->secondary_header_packets = 0;
...@@ -485,13 +485,13 @@ static void Ogg_DecodePacket( demux_t *p_demux, ...@@ -485,13 +485,13 @@ static void Ogg_DecodePacket( demux_t *p_demux,
} }
if( p_oggpacket->bytes >= 7 && if( p_oggpacket->bytes >= 7 &&
! memcmp ( &p_oggpacket->packet[0], "Annodex", 7 ) ) ! memcmp ( p_oggpacket->packet, "Annodex", 7 ) )
{ {
/* it's an Annodex packet -- skip it (do nothing) */ /* it's an Annodex packet -- skip it (do nothing) */
return; return;
} }
else if( p_oggpacket->bytes >= 7 && else if( p_oggpacket->bytes >= 7 &&
! memcmp ( &p_oggpacket->packet[0], "AnxData", 7 ) ) ! memcmp ( p_oggpacket->packet, "AnxData", 7 ) )
{ {
/* it's an AnxData packet -- skip it (do nothing) */ /* it's an AnxData packet -- skip it (do nothing) */
return; return;
...@@ -691,7 +691,7 @@ static void Ogg_DecodePacket( demux_t *p_demux, ...@@ -691,7 +691,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
} }
i_header_len++; i_header_len++;
if( p_block->i_buffer >= i_header_len ) if( p_block->i_buffer >= (unsigned int)i_header_len )
p_block->i_buffer -= i_header_len; p_block->i_buffer -= i_header_len;
else else
p_block->i_buffer = 0; p_block->i_buffer = 0;
...@@ -770,14 +770,14 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux ) ...@@ -770,14 +770,14 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
/* Check for Vorbis header */ /* Check for Vorbis header */
if( oggpacket.bytes >= 7 && if( oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[1], "vorbis", 6 ) ) ! memcmp( oggpacket.packet, "\x01vorbis", 6 ) )
{ {
Ogg_ReadVorbisHeader( p_stream, &oggpacket ); Ogg_ReadVorbisHeader( p_stream, &oggpacket );
msg_Dbg( p_demux, "found vorbis header" ); msg_Dbg( p_demux, "found vorbis header" );
} }
/* Check for Speex header */ /* Check for Speex header */
else if( oggpacket.bytes >= 7 && else if( oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[0], "Speex", 5 ) ) ! memcmp( oggpacket.packet, "Speex", 5 ) )
{ {
Ogg_ReadSpeexHeader( p_stream, &oggpacket ); Ogg_ReadSpeexHeader( p_stream, &oggpacket );
msg_Dbg( p_demux, "found speex header, channels: %i, " msg_Dbg( p_demux, "found speex header, channels: %i, "
...@@ -787,7 +787,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux ) ...@@ -787,7 +787,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
} }
/* Check for Flac header (< version 1.1.1) */ /* Check for Flac header (< version 1.1.1) */
else if( oggpacket.bytes >= 4 && else if( oggpacket.bytes >= 4 &&
! memcmp( &oggpacket.packet[0], "fLaC", 4 ) ) ! memcmp( oggpacket.packet, "fLaC", 4 ) )
{ {
msg_Dbg( p_demux, "found FLAC header" ); msg_Dbg( p_demux, "found FLAC header" );
...@@ -820,7 +820,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux ) ...@@ -820,7 +820,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
} }
/* Check for Theora header */ /* Check for Theora header */
else if( oggpacket.bytes >= 7 && else if( oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[1], "theora", 6 ) ) ! memcmp( oggpacket.packet, "\x80theora", 6 ) )
{ {
Ogg_ReadTheoraHeader( p_stream, &oggpacket ); Ogg_ReadTheoraHeader( p_stream, &oggpacket );
...@@ -850,7 +850,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux ) ...@@ -850,7 +850,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
} }
/* Check for Annodex header */ /* Check for Annodex header */
else if( oggpacket.bytes >= 7 && else if( oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[0], "Annodex", 7 ) ) ! memcmp( oggpacket.packet, "Annodex", 7 ) )
{ {
Ogg_ReadAnnodexHeader( VLC_OBJECT(p_demux), p_stream, Ogg_ReadAnnodexHeader( VLC_OBJECT(p_demux), p_stream,
&oggpacket ); &oggpacket );
...@@ -860,7 +860,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux ) ...@@ -860,7 +860,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
} }
/* Check for Annodex header */ /* Check for Annodex header */
else if( oggpacket.bytes >= 7 && else if( oggpacket.bytes >= 7 &&
! memcmp( &oggpacket.packet[0], "AnxData", 7 ) ) ! memcmp( oggpacket.packet, "AnxData", 7 ) )
{ {
Ogg_ReadAnnodexHeader( VLC_OBJECT(p_demux), p_stream, Ogg_ReadAnnodexHeader( VLC_OBJECT(p_demux), p_stream,
&oggpacket ); &oggpacket );
...@@ -1080,6 +1080,15 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux ) ...@@ -1080,6 +1080,15 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
p_ogg->i_streams--; p_ogg->i_streams--;
} }
} }
else if( oggpacket.bytes >= 7 &&
! memcmp( oggpacket.packet, "fishead", 7 ) )
{
/* Skeleton */
msg_Dbg( p_demux, "stream %d is a skeleton",
p_ogg->i_streams-1 );
/* FIXME: https://trac.videolan.org/vlc/ticket/1412 */
}
else else
{ {
msg_Dbg( p_demux, "stream %d is of unknown type", msg_Dbg( p_demux, "stream %d is of unknown type",
...@@ -1325,7 +1334,7 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this, ...@@ -1325,7 +1334,7 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this,
ogg_packet *p_oggpacket ) ogg_packet *p_oggpacket )
{ {
if( p_oggpacket->bytes >= 28 && if( p_oggpacket->bytes >= 28 &&
!memcmp( &p_oggpacket->packet[0], "Annodex", 7 ) ) !memcmp( p_oggpacket->packet, "Annodex", 7 ) )
{ {
oggpack_buffer opb; oggpack_buffer opb;
...@@ -1344,7 +1353,7 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this, ...@@ -1344,7 +1353,7 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this,
timebase_denominator = GetQWLE( &p_oggpacket->packet[24] ); timebase_denominator = GetQWLE( &p_oggpacket->packet[24] );
} }
else if( p_oggpacket->bytes >= 42 && else if( p_oggpacket->bytes >= 42 &&
!memcmp( &p_oggpacket->packet[0], "AnxData", 7 ) ) !memcmp( p_oggpacket->packet, "AnxData", 7 ) )
{ {
uint64_t granule_rate_numerator; uint64_t granule_rate_numerator;
uint64_t granule_rate_denominator; uint64_t granule_rate_denominator;
......
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