[vlc-commits] Fixed packetization of variable block size FLAC stream (closed #4758).
Laurent Aimar
git at videolan.org
Sun Jun 26 00:47:44 CEST 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jun 26 00:45:19 2011 +0200| [117b614a7f61c3065340890e0346434d3d88b14a] | committer: Laurent Aimar
Fixed packetization of variable block size FLAC stream (closed #4758).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=117b614a7f61c3065340890e0346434d3d88b14a
---
modules/packetizer/flac.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index 1fa3f32..d9a2be3 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -237,7 +237,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
while( block_PeekBytes( &p_sys->bytestream, p_header, 2 )
== VLC_SUCCESS )
{
- if( p_header[0] == 0xFF && p_header[1] == 0xF8 )
+ if( p_header[0] == 0xFF && (p_header[1] & 0xFE) == 0xF8 )
{
p_sys->i_state = STATE_SYNC;
break;
@@ -304,7 +304,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
MAX_FLAC_HEADER_SIZE )
== VLC_SUCCESS )
{
- if( p_header[0] == 0xFF && p_header[1] == 0xF8 )
+ if( p_header[0] == 0xFF && (p_header[1] & 0xFE) == 0xF8 )
{
/* Check if frame is valid and get frame info */
int i_frame_length =
@@ -379,11 +379,8 @@ static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
unsigned i_blocksize = 0;
int i_blocksize_hint = 0, i_sample_rate_hint = 0;
- bool b_fixed_blocksize = ( p_sys->b_stream_info &&
- p_sys->stream_info.min_blocksize == p_sys->stream_info.max_blocksize );
-
/* Check syncword */
- if( p_buf[0] != 0xFF || p_buf[1] != 0xF8 ) return 0;
+ if( p_buf[0] != 0xFF || (p_buf[1] & 0xFE) != 0xF8 ) return 0;
/* Check there is no emulated sync code in the rest of the header */
if( p_buf[2] == 0xff || p_buf[3] == 0xFF ) return 0;
@@ -392,7 +389,8 @@ static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
switch( i_temp = p_buf[2] >> 4 )
{
case 0:
- if( b_fixed_blocksize )
+ if( p_sys->b_stream_info &&
+ p_sys->stream_info.min_blocksize == p_sys->stream_info.max_blocksize )
i_blocksize = p_sys->stream_info.min_blocksize;
else return 0; /* We can't do anything with this */
break;
More information about the vlc-commits
mailing list