/*****************************************************************************
* aiff.c: Audio Interchange File Format demuxer
*****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2004 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
uint8_t *p_peek;
- if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 )
+ 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 ) )
{
- msg_Err( p_demux, "cannot peek" );
- return VLC_EGENERIC;
- }
- if( strncmp( &p_peek[0], "FORM", 4 ) || strncmp( &p_peek[8], "AIFF", 4 ) )
- {
- msg_Warn( p_demux, "AIFF module discarded" );
return VLC_EGENERIC;
}
msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size );
- if( !strncmp( &p_peek[0], "COMM", 4 ) )
+ if( !strncmp( (char *)&p_peek[0], "COMM", 4 ) )
{
if( stream_Peek( p_demux->s, &p_peek, 18 + 8 ) < 18 + 8 )
{
msg_Dbg( p_demux, "COMM: channels=%d samples_frames=%d bits=%d rate=%d",
GetWBE( &p_peek[8] ), GetDWBE( &p_peek[10] ), GetWBE( &p_peek[14] ), GetF80BE( &p_peek[16] ) );
}
- else if( !strncmp( &p_peek[0], "SSND", 4 ) )
+ else if( !strncmp( (char *)&p_peek[0], "SSND", 4 ) )
{
if( stream_Peek( p_demux->s, &p_peek, 8 + 8 ) < 8 + 8 )
{
}
p_sys->i_ssnd_pos = stream_Tell( p_demux->s );
- p_sys->i_ssnd_size= i_size;
+ p_sys->i_ssnd_size = i_size;
p_sys->i_ssnd_offset = GetDWBE( &p_peek[8] );
p_sys->i_ssnd_blocksize = GetDWBE( &p_peek[12] );
}
/* Skip this chunk */
- if( stream_Read( p_demux->s, NULL, i_size + 8 ) != i_size + 8 )
+ i_size += 8;
+ if( stream_Read( p_demux->s, NULL, i_size ) != (int)i_size )
{
msg_Warn( p_demux, "incomplete file" );
goto error;