summaryrefslogtreecommitdiff
path: root/libavcodec/videotoolbox.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-10-31 15:15:27 +0100
committerAman Gupta <aman@tmm1.net>2017-11-13 15:10:07 -0800
commit9283a4f19b762b25bc8e5e8f402fefb9097a1397 (patch)
treef7baeb3fd965dfcfa7d39a93498fc7d0276b90d1 /libavcodec/videotoolbox.c
parentb7f963c4444d709a89156fb0f094c232fe1eacd6 (diff)
avcodec/videotoolbox: fix opaque_ref handling
This is a partial fix - to fix videotoolbox fully (with multithreaded hwaccel decoding), much more work would be required. Before this change, an assertion failure would trigger: $ ffmpeg -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld -i h264.ts -f null -y /dev/null Assertion (frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) || !(avctx->codec->capabilities & (1 << 1)) failed at libavcodec/decode.c:620 Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 4547ffef34..9eeada30ba 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -27,6 +27,7 @@
#include "libavutil/avutil.h"
#include "libavutil/hwcontext.h"
#include "bytestream.h"
+#include "decode.h"
#include "h264dec.h"
#include "hevcdec.h"
#include "mpegvideo.h"
@@ -70,6 +71,10 @@ static int videotoolbox_buffer_copy(VTContext *vtctx,
int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
{
+ int ret = ff_attach_decode_data(frame);
+ if (ret < 0)
+ return ret;
+
frame->width = avctx->width;
frame->height = avctx->height;
frame->format = avctx->pix_fmt;