/* for frame skipping algo */
int b_hurry_up;
+ enum AVDiscard i_skip_frame;
+ enum AVDiscard i_skip_idct;
/* how many decoded frames are late */
int i_late_frames;
p_sys->p_context->skip_frame = AVDISCARD_NONE;
break;
}
+ p_sys->i_skip_frame = p_sys->p_context->skip_frame;
var_Create( p_dec, "ffmpeg-skip-idct", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Get( p_dec, "ffmpeg-skip-idct", &val );
p_sys->p_context->skip_idct = AVDISCARD_NONE;
break;
}
+ p_sys->i_skip_idct = p_sys->p_context->skip_idct;
/* ***** ffmpeg direct rendering ***** */
p_sys->b_direct_rendering = 0;
p_block->i_pts = p_block->i_dts = 0;
}
- /* TODO implement it in a better way */
/* A good idea could be to decode all I pictures and see for the other */
if( !p_dec->b_pace_control &&
p_sys->b_hurry_up &&
b_drawpicture = 0;
if( p_sys->i_late_frames < 8 )
{
- p_sys->p_context->skip_frame = AVDISCARD_BIDIR;
+ p_sys->p_context->skip_frame = AVDISCARD_NONKEY;
}
else
{
/* picture too late, won't decode
* but break picture until a new I, and for mpeg4 ...*/
- p_sys->p_context->skip_frame = AVDISCARD_NONKEY;
p_sys->i_late_frames--; /* needed else it will never be decrease */
block_Release( p_block );
p_sys->i_buffer = 0;
else
{
if( p_sys->b_hurry_up )
- p_sys->p_context->skip_frame = AVDISCARD_DEFAULT;
+ p_sys->p_context->skip_frame = p_sys->i_skip_frame;
if( !(p_block->i_flags & BLOCK_FLAG_PREROLL) )
b_drawpicture = 1;
else
if( p_sys->p_context->width <= 0 || p_sys->p_context->height <= 0 )
{
if( p_sys->b_hurry_up )
- p_sys->p_context->skip_frame = AVDISCARD_ALL;
+ p_sys->p_context->skip_frame = p_sys->i_skip_frame;
b_null_size = VLC_TRUE;
}
/* Reparse it to not drop the I frame */
b_null_size = VLC_FALSE;
if( p_sys->b_hurry_up )
- p_sys->p_context->skip_frame = AVDISCARD_DEFAULT;
+ p_sys->p_context->skip_frame = p_sys->i_skip_frame;
i_used = avcodec_decode_video( p_sys->p_context, p_sys->p_ff_pic,
&b_gotpicture,
(uint8_t*)p_sys->p_buffer, p_sys->i_buffer );