/* Check if we are dealing with an ogg stream */
if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
- if( strcmp( p_demux->psz_demux, "ogg" ) && strncmp( p_peek, "OggS", 4 ) )
+ if( strcmp( p_demux->psz_demux, "ogg" ) && memcmp( p_peek, "OggS", 4 ) )
{
return VLC_EGENERIC;
}
{
if( p_stream->fmt.i_codec == VLC_FOURCC('t','h','e','o') &&
oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[1], "theora", 6 ) )
+ ! memcmp( &oggpacket.packet[1], "theora", 6 ) )
{
Ogg_ReadTheoraHeader( p_stream, &oggpacket );
p_stream->secondary_header_packets = 0;
}
else if( p_stream->fmt.i_codec == VLC_FOURCC('v','o','r','b') &&
oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[1], "vorbis", 6 ) )
+ ! memcmp( &oggpacket.packet[1], "vorbis", 6 ) )
{
Ogg_ReadVorbisHeader( p_stream, &oggpacket );
p_stream->secondary_header_packets = 0;
{
demux_sys_t *p_ogg = p_demux->p_sys ;
int i_read = 0;
- byte_t *p_buffer;
+ char *p_buffer;
while( ogg_sync_pageout( &p_ogg->oy, p_oggpage ) != 1 )
{
}
if( p_oggpacket->bytes >= 7 &&
- ! strncmp ( &p_oggpacket->packet[0], "Annodex", 7 ) )
+ ! memcmp ( &p_oggpacket->packet[0], "Annodex", 7 ) )
{
/* it's an Annodex packet -- skip it (do nothing) */
return;
}
else if( p_oggpacket->bytes >= 7 &&
- ! strncmp ( &p_oggpacket->packet[0], "AnxData", 7 ) )
+ ! memcmp ( &p_oggpacket->packet[0], "AnxData", 7 ) )
{
/* it's an AnxData packet -- skip it (do nothing) */
return;
/* Check for Vorbis header */
if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[1], "vorbis", 6 ) )
+ ! memcmp( &oggpacket.packet[1], "vorbis", 6 ) )
{
Ogg_ReadVorbisHeader( p_stream, &oggpacket );
msg_Dbg( p_demux, "found vorbis header" );
}
/* Check for Speex header */
else if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[0], "Speex", 5 ) )
+ ! memcmp( &oggpacket.packet[0], "Speex", 5 ) )
{
Ogg_ReadSpeexHeader( p_stream, &oggpacket );
msg_Dbg( p_demux, "found speex header, channels: %i, "
}
/* Check for Flac header (< version 1.1.1) */
else if( oggpacket.bytes >= 4 &&
- ! strncmp( &oggpacket.packet[0], "fLaC", 4 ) )
+ ! memcmp( &oggpacket.packet[0], "fLaC", 4 ) )
{
msg_Dbg( p_demux, "found FLAC header" );
}
/* Check for Flac header (>= version 1.1.1) */
else if( oggpacket.bytes >= 13 && oggpacket.packet[0] ==0x7F &&
- ! strncmp( &oggpacket.packet[1], "FLAC", 4 ) &&
- ! strncmp( &oggpacket.packet[9], "fLaC", 4 ) )
+ ! memcmp( &oggpacket.packet[1], "FLAC", 4 ) &&
+ ! memcmp( &oggpacket.packet[9], "fLaC", 4 ) )
{
int i_packets = ((int)oggpacket.packet[7]) << 8 |
oggpacket.packet[8];
}
/* Check for Theora header */
else if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[1], "theora", 6 ) )
+ ! memcmp( &oggpacket.packet[1], "theora", 6 ) )
{
Ogg_ReadTheoraHeader( p_stream, &oggpacket );
}
/* Check for Tarkin header */
else if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[1], "tarkin", 6 ) )
+ ! memcmp( &oggpacket.packet[1], "tarkin", 6 ) )
{
oggpack_buffer opb;
}
/* Check for Annodex header */
else if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[0], "Annodex", 7 ) )
+ ! memcmp( &oggpacket.packet[0], "Annodex", 7 ) )
{
Ogg_ReadAnnodexHeader( VLC_OBJECT(p_demux), p_stream,
&oggpacket );
}
/* Check for Annodex header */
else if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[0], "AnxData", 7 ) )
+ ! memcmp( &oggpacket.packet[0], "AnxData", 7 ) )
{
Ogg_ReadAnnodexHeader( VLC_OBJECT(p_demux), p_stream,
&oggpacket );
}
else if( oggpacket.bytes >= 142 &&
- !strncmp( &oggpacket.packet[1],
+ !memcmp( &oggpacket.packet[1],
"Direct Show Samples embedded in Ogg", 35 ))
{
/* Old header type */
logical_stream_t *p_stream,
ogg_packet *p_oggpacket )
{
- if( ! strncmp( &p_oggpacket->packet[0], "Annodex", 7 ) )
+ if( ! memcmp( &p_oggpacket->packet[0], "Annodex", 7 ) )
{
oggpack_buffer opb;
timebase_numerator = GetQWLE( &p_oggpacket->packet[16] );
timebase_denominator = GetQWLE( &p_oggpacket->packet[24] );
}
- else if( ! strncmp( &p_oggpacket->packet[0], "AnxData", 7 ) )
+ else if( ! memcmp( &p_oggpacket->packet[0], "AnxData", 7 ) )
{
uint64_t granule_rate_numerator;
uint64_t granule_rate_denominator;