aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rv34.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-12 15:47:42 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-15 13:08:37 +0200
commitd2bc039501cdfe2067365ca1bf4be7201f071c05 (patch)
tree6e5b86aef80f94591c7e6f3574f90e560c711441 /libavcodec/rv34.c
parent4f4dc0a1a29d3689ba8e73a08c13d4f2e152aad1 (diff)
downloadffmpeg-d2bc039501cdfe2067365ca1bf4be7201f071c05.tar.gz
avcodec/error_resilience: Make applying decode_error_flags optional
Add a pointer parameter that if supplied will be used to return the updated decode_error_flags. This will allow to fix several races when using frame-threading; these resulted from AVFrame that the earlier code updated concurrently being used as source in an av_frame_ref() call in the decoder's update_thread_context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r--libavcodec/rv34.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index af4d6a3400..e9660bb457 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1560,7 +1560,7 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict)
MpegEncContext *s = &r->s;
int got_picture = 0, ret;
- ff_er_frame_end(&s->er);
+ ff_er_frame_end(&s->er, NULL);
ff_mpv_frame_end(s);
s->mb_num_left = 0;
@@ -1655,7 +1655,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict,
av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.\n",
s->mb_num_left);
if (!s->context_reinit)
- ff_er_frame_end(&s->er);
+ ff_er_frame_end(&s->er, NULL);
ff_mpv_frame_end(s);
}
@@ -1790,7 +1790,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict,
av_log(avctx, AV_LOG_INFO, "marking unfished frame as finished\n");
/* always mark the current frame as finished, frame-mt supports
* only complete frames */
- ff_er_frame_end(&s->er);
+ ff_er_frame_end(&s->er, NULL);
ff_mpv_frame_end(s);
s->mb_num_left = 0;
ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);