/*****************************************************************************
* libmp4.c : LibMP4 library for mp4 module for vlc
*****************************************************************************
- * Copyright (C) 2001-2004, 2010 the VideoLAN team
+ * Copyright (C) 2001-2004, 2010 VLC authors and VideoLAN
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
p_dvc1 = p_box->data.p_dvc1;
MP4_GET1BYTE( p_dvc1->i_profile_level ); /* profile is on 4bits, level 3bits */
- if( (p_dvc1->i_profile_level & 0xf0) >> 4 != 0x06 )
+ uint8_t i_profile = (p_dvc1->i_profile_level & 0xf0) >> 4;
+ if( i_profile != 0x06 && i_profile != 0x0c )
{
- msg_Warn( p_stream, "unsupported VC-1 profile, please report" );
+ msg_Warn( p_stream, "unsupported VC-1 profile (%"PRIu8"), please report", i_profile );
MP4_READBOX_EXIT( 0 );
}
#ifdef MP4_VERBOSE
msg_Dbg( p_stream,
- "read box: \"dvc1\" profile=%i level=%i",
- p_dvc1->i_profile_level & 0xf0 >> 4, p_dvc1->i_profile_level & 0x0e >> 1 );
+ "read box: \"dvc1\" profile=%"PRIu8" level=%i",
+ i_profile, p_dvc1->i_profile_level & 0x0e >> 1 );
#endif
MP4_READBOX_EXIT( 1 );
if( (p_tmp_box->i_type == ATOM_uuid && !CmpUUID( &p_tmp_box->i_uuid, &SmooBoxUUID )) )
{
+ free( p_tmp_box );
return MP4_BoxGetSmooBox( s );
}
else if( p_tmp_box->i_type == ATOM_ftyp )
{
+ free( p_tmp_box );
return MP4_BoxGetRoot( s );
}
free( p_tmp_box );
return p_root;
p_root->i_size = stream_Size( s );
- stream_Seek( p_stream, 0 );
- /* Get the rest of the file */
- i_result = MP4_ReadBoxContainerRaw( p_stream, p_root );
+ if( stream_Tell( s ) < stream_Size( s ) )
+ {
+ /* Get the rest of the file */
+ i_result = MP4_ReadBoxContainerRaw( p_stream, p_root );
- if( !i_result )
- goto error;
+ if( !i_result )
+ goto error;
+ }
MP4_Box_t *p_moov;
MP4_Box_t *p_cmov;