[vlc-commits] [Git][videolan/vlc][master] codec: avcodec: don't touch AVCodecContext active_thread_type
Steve Lhomme
gitlab at videolan.org
Mon Jun 14 10:09:14 UTC 2021
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
a5a69e60 by Zhao Zhili at 2021-06-14T08:10:16+00:00
codec: avcodec: don't touch AVCodecContext active_thread_type
active_thread_type is set by libavcodec.
- - - - -
1 changed file:
- modules/codec/avcodec/video.c
Changes:
=====================================
modules/codec/avcodec/video.c
=====================================
@@ -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;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a5a69e60488b12989f596bcadf1e8f78ce882d17
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a5a69e60488b12989f596bcadf1e8f78ce882d17
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list