demux_sys_t *p_sys = p_demux->p_sys;
virtual_segment_c *p_vsegment = p_sys->p_current_segment;
matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
- mtime_t i_time_offset = 0;
int64_t i_global_position = -1;
int i_index;
for( i_index = 0; i_index < p_segment->i_index; i_index++ )
{
if( p_segment->p_indexes[i_index].i_position >= i_pos &&
- p_segment->p_indexes[i_index].i_time > 0 )
+ p_segment->p_indexes[i_index].i_time != -1 )
break;
}
if( i_index == p_segment->i_index )
}
}
}
- p_vsegment->Seek( *p_demux, i_date, i_time_offset, p_chapter, i_global_position );
+ p_vsegment->Seek( *p_demux, i_date, p_chapter, i_global_position );
}
/* Needed by matroska_segment::Seek() and Seek */
void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock,
- mtime_t i_pts, mtime_t i_duration, bool f_mandatory )
+ mtime_t i_pts, mtime_t i_duration, bool b_key_picture,
+ bool b_discardable_picture )
{
demux_sys_t *p_sys = p_demux->p_sys;
matroska_segment_c *p_segment = p_sys->p_current_segment->CurrentSegment();
{
tk->b_inited = false;
if( tk->fmt.i_cat == VIDEO_ES || tk->fmt.i_cat == AUDIO_ES )
- tk->i_last_dts = i_pts;
+ tk->i_last_dts = VLC_TS_INVALID;
return;
}
}
if( simpleblock != NULL )
{
data = &simpleblock->GetBuffer(i_frame);
- // condition when the DTS is correct (keyframe or B frame == NOT P frame)
- f_mandatory = simpleblock->IsDiscardable() || simpleblock->IsKeyframe();
}
else
{
data = &block->GetBuffer(i_frame);
- // condition when the DTS is correct (keyframe or B frame == NOT P frame)
}
frame_size += data->Size();
if( !data->Buffer() || data->Size() > frame_size || frame_size > block_size )
handle_real_audio(p_demux, tk, p_block, i_pts);
block_Release(p_block);
i_pts = ( tk->i_default_duration )?
- i_pts + ( mtime_t )( tk->i_default_duration / 1000 ):
+ i_pts + ( mtime_t )tk->i_default_duration:
VLC_TS_INVALID;
continue;
}
break;
}
+ if ( b_key_picture )
+ p_block->i_flags |= BLOCK_FLAG_TYPE_I;
if( tk->fmt.i_cat != VIDEO_ES )
{
else
{
p_block->i_pts = i_pts;
- if ( f_mandatory )
+ // condition when the DTS is correct (keyframe or B frame == NOT P frame)
+ if ( b_key_picture || b_discardable_picture )
p_block->i_dts = p_block->i_pts;
else
- p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )( tk->i_default_duration / 1000 ) );
+ p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )tk->i_default_duration );
}
}
if( p_block->i_dts > VLC_TS_INVALID &&
/* use time stamp only for first block */
i_pts = ( tk->i_default_duration )?
- i_pts + ( mtime_t )( tk->i_default_duration / 1000 ):
+ i_pts + ( mtime_t )tk->i_default_duration:
VLC_TS_INVALID;
}
}
break;
}
- BlockDecode( p_demux, block, simpleblock, p_sys->i_pts, i_block_duration, b_key_picture || b_discardable_picture );
+ BlockDecode( p_demux, block, simpleblock, p_sys->i_pts, i_block_duration, b_key_picture, b_discardable_picture );
delete block;