Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- libswscale/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libswscale/utils.c b/libswscale/utils.c index 053c6bb76b..fb788fc330 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1340,13 +1340,10 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, int ret = 0; enum AVPixelFormat tmpFmt; static const float float_mult = 1.0f / 255.0f; - static AVOnce rgb2rgb_once = AV_ONCE_INIT; cpu_flags = av_get_cpu_flags(); flags = c->flags; emms_c(); - if (ff_thread_once(&rgb2rgb_once, ff_sws_rgb2rgb_init) != 0) - return AVERROR_UNKNOWN; unscaled = (srcW == dstW && srcH == dstH); @@ -2043,6 +2040,7 @@ fail: // FIXME replace things by appropriate error codes av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) { + static AVOnce rgb2rgb_once = AV_ONCE_INIT; int ret; c->frame_src = av_frame_alloc(); @@ -2050,6 +2048,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, if (!c->frame_src || !c->frame_dst) return AVERROR(ENOMEM); + if (ff_thread_once(&rgb2rgb_once, ff_sws_rgb2rgb_init) != 0) + return AVERROR_UNKNOWN; + if (c->nb_threads != 1) { ret = context_init_threaded(c, srcFilter, dstFilter); if (ret < 0 || c->nb_threads > 1) -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".