Skip to content
Snippets Groups Projects
Commit a5a69e60 authored by Zhao Zhili's avatar Zhao Zhili Committed by Steve Lhomme
Browse files

codec: avcodec: don't touch AVCodecContext active_thread_type

active_thread_type is set by libavcodec.
parent dfd92fa0
No related branches found
No related tags found
1 merge request!240codec: avcodec: don't touch AVCodecContext active_thread_type
Pipeline #106743 passed with stage
in 47 minutes and 4 seconds
......@@ -383,20 +383,15 @@ static int OpenVideoCodec( decoder_t *p_dec )
cc_Init( &p_sys->cc );
set_video_color_settings( &p_dec->fmt_in.video, ctx );
if( p_dec->fmt_in.video.i_frame_rate_base &&
if( var_InheritBool(p_dec, "low-delay") ||
( p_dec->fmt_in.video.i_frame_rate_base &&
p_dec->fmt_in.video.i_frame_rate &&
(double) p_dec->fmt_in.video.i_frame_rate /
p_dec->fmt_in.video.i_frame_rate_base < 6 )
p_dec->fmt_in.video.i_frame_rate_base < 6 ) )
{
ctx->flags |= AV_CODEC_FLAG_LOW_DELAY;
}
if( var_InheritBool(p_dec, "low-delay") )
{
ctx->flags |= AV_CODEC_FLAG_LOW_DELAY;
ctx->active_thread_type = FF_THREAD_SLICE;
}
ret = ffmpeg_OpenCodec( p_dec, ctx, codec );
if( ret < 0 )
return ret;
......@@ -558,6 +553,9 @@ int InitVideoDec( vlc_object_t *obj )
break;
}
if( var_InheritBool(p_dec, "low-delay") )
p_context->thread_type &= ~FF_THREAD_FRAME;
if( p_context->thread_type & FF_THREAD_FRAME )
p_dec->i_extra_picture_buffers = 2 * p_context->thread_count;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment