summaryrefslogtreecommitdiff
path: root/libavcodec/h264_picture.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/h264_picture.c')
-rw-r--r--libavcodec/h264_picture.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c
index c7f5b64b99..2661ff4698 100644
--- a/libavcodec/h264_picture.c
+++ b/libavcodec/h264_picture.c
@@ -30,18 +30,19 @@
#include "avcodec.h"
#include "h264dec.h"
#include "mpegutils.h"
+#include "thread.h"
#include "threadframe.h"
void ff_h264_unref_picture(H264Context *h, H264Picture *pic)
{
- int off = offsetof(H264Picture, tf_grain) + sizeof(pic->tf_grain);
+ int off = offsetof(H264Picture, f_grain) + sizeof(pic->f_grain);
int i;
if (!pic->f || !pic->f->buf[0])
return;
ff_thread_release_ext_buffer(h->avctx, &pic->tf);
- ff_thread_release_buffer(h->avctx, &pic->tf_grain);
+ ff_thread_release_buffer(h->avctx, pic->f_grain);
av_buffer_unref(&pic->hwaccel_priv_buf);
av_buffer_unref(&pic->qscale_table_buf);
@@ -102,9 +103,7 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
goto fail;
if (src->needs_fg) {
- av_assert0(src->tf_grain.f == src->f_grain);
- dst->tf_grain.f = dst->f_grain;
- ret = ff_thread_ref_frame(&dst->tf_grain, &src->tf_grain);
+ ret = av_frame_ref(dst->f_grain, src->f_grain);
if (ret < 0)
goto fail;
}
@@ -161,10 +160,8 @@ int ff_h264_replace_picture(H264Context *h, H264Picture *dst, const H264Picture
goto fail;
if (src->needs_fg) {
- av_assert0(src->tf_grain.f == src->f_grain);
- dst->tf_grain.f = dst->f_grain;
- ff_thread_release_buffer(h->avctx, &dst->tf_grain);
- ret = ff_thread_ref_frame(&dst->tf_grain, &src->tf_grain);
+ ff_thread_release_buffer(h->avctx, dst->f_grain);
+ ret = av_frame_ref(dst->f_grain, src->f_grain);
if (ret < 0)
goto fail;
}