Commit a14c0186 authored by Laurent Aimar's avatar Laurent Aimar

Fixed aiff support for stereo files and files with odd chunk size.

parent a878f3ac
...@@ -103,11 +103,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -103,11 +103,10 @@ static int Open( vlc_object_t *p_this )
uint8_t *p_peek; uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) return VLC_EGENERIC; if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 )
return VLC_EGENERIC;
if( strncmp( (char *)&p_peek[0], "FORM", 4 ) || strncmp( (char *)&p_peek[8], "AIFF", 4 ) ) if( strncmp( (char *)&p_peek[0], "FORM", 4 ) || strncmp( (char *)&p_peek[8], "AIFF", 4 ) )
{
return VLC_EGENERIC; return VLC_EGENERIC;
}
/* skip aiff header */ /* skip aiff header */
stream_Read( p_demux->s, NULL, 12 ); stream_Read( p_demux->s, NULL, 12 );
...@@ -157,6 +156,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -157,6 +156,8 @@ static int Open( vlc_object_t *p_this )
/* Skip this chunk */ /* Skip this chunk */
i_size += 8; i_size += 8;
if( (i_size % 2) != 0 )
i_size++;
if( stream_Read( p_demux->s, NULL, i_size ) != (int)i_size ) if( stream_Read( p_demux->s, NULL, i_size ) != (int)i_size )
{ {
msg_Warn( p_demux, "incomplete file" ); msg_Warn( p_demux, "incomplete file" );
...@@ -168,7 +169,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -168,7 +169,7 @@ static int Open( vlc_object_t *p_this )
p_sys->i_ssnd_end = p_sys->i_ssnd_start + p_sys->i_ssnd_size; p_sys->i_ssnd_end = p_sys->i_ssnd_start + p_sys->i_ssnd_size;
p_sys->i_ssnd_fsize = p_sys->fmt.audio.i_channels * p_sys->i_ssnd_fsize = p_sys->fmt.audio.i_channels *
( p_sys->fmt.audio.i_bitspersample + 7 ) / 8; ((p_sys->fmt.audio.i_bitspersample + 7) / 8);
if( p_sys->i_ssnd_fsize <= 0 ) if( p_sys->i_ssnd_fsize <= 0 )
{ {
......
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