tk->i_blocksize = 0; /* fix vorbis VBR decoding */
}
+ if ( tk->i_codec == VLC_CODEC_MP4A )
+ {
+ tk->i_samplesize = 0; /* ADTS/AAC VBR */
+ }
+
es_format_Init( &fmt, AUDIO_ES, tk->i_codec );
fmt.audio.i_channels = p_auds->p_wf->nChannels;
(mtime_t)p_avih->i_microsecperframe /
CLOCK_FREQ )
{
- if( !vlc_object_alive( p_demux) )
- goto error;
-
msg_Warn( p_demux, "broken or missing index, 'seek' will be "
"approximative or will exhibit strange behavior" );
if( (i_do_index == 0 || i_do_index == 3) && !b_index )
* affect the reading speed too much. */
if( !(++i_loop_count % 1024) )
{
- if( !vlc_object_alive (p_demux) ) return -1;
msleep( 10000 );
if( !(i_loop_count % (1024 * 10)) )
for( ;; )
{
- if( !vlc_object_alive (p_demux) ) return VLC_EGENERIC;
-
if( AVI_PacketGetHeader( p_demux, &avi_pk ) )
{
msg_Warn( p_demux, "cannot get packet header" );
* affect the reading speed too much. */
if( !(++i_loop_count % 1024) )
{
- if( !vlc_object_alive (p_demux) ) return VLC_EGENERIC;
msleep( 10000 );
if( !(i_loop_count % (1024 * 10)) )
* this code is called only on broken files). */
if( !(++i_count % 1024) )
{
- if( !vlc_object_alive (p_demux) ) return VLC_EGENERIC;
-
msleep( 10000 );
if( !(i_count % (1024 * 10)) )
msg_Warn( p_demux, "trying to resync..." );
*pi_offset = 0;
else
*pi_offset = i_movi_content;
+
+ if( p_idx1->i_entry_count )
+ {
+ /* Invalidate offset if index refers past the data section to avoid false
+ positives when the offset equals sample size */
+ size_t i_dataend = *pi_offset + p_idx1->entry[p_idx1->i_entry_count - 1].i_pos +
+ p_idx1->entry[p_idx1->i_entry_count - 1].i_length;
+ if( i_dataend > p_movi->i_chunk_pos + p_movi->i_chunk_size )
+ *pi_offset = 0;
+ }
}
else
{
*pi_offset = 0;
}
+
return VLC_SUCCESS;
}
{
avi_packet_t pk;
- if( !vlc_object_alive (p_demux) )
- break;
-
/* Don't update/check dialog too often */
if( p_dialog && mdate() - i_dialog_update > 100000 )
{