Commit 9283a4f1 authored by wm4's avatar wm4 Committed by Aman Gupta

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: 's avatarAman Gupta <aman@tmm1.net>
parent b7f963c4
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment