Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-08-09 00:20:44 +0300
committerJames Almer <jamrial@gmail.com>2021-08-10 21:11:46 +0300
commit90bf83d6f1fb04a0dea7d87e536ea7cb25fed21b (patch)
treea846e079034d7782504fe66d5447598ada563a45 /libavcodec/h264_slice.c
parenta2a5a579bc408cf6fae5751e6a6f2a3c820c3c30 (diff)
avcodec/h264_slice: use ff_h264_replace_picture when syncing thread contexts
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index a31e804620..0d7107d455 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -379,19 +379,15 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
h->droppable = h1->droppable;
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
- ff_h264_unref_picture(h, &h->DPB[i]);
- if (h1->DPB[i].f->buf[0] &&
- (ret = ff_h264_ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
+ ret = ff_h264_replace_picture(h, &h->DPB[i], &h1->DPB[i]);
+ if (ret < 0)
return ret;
}
h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1);
- ff_h264_unref_picture(h, &h->cur_pic);
- if (h1->cur_pic.f->buf[0]) {
- ret = ff_h264_ref_picture(h, &h->cur_pic, &h1->cur_pic);
- if (ret < 0)
- return ret;
- }
+ ret = ff_h264_replace_picture(h, &h->cur_pic, &h1->cur_pic);
+ if (ret < 0)
+ return ret;
h->enable_er = h1->enable_er;
h->workaround_bugs = h1->workaround_bugs;