diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-03-24 20:55:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-01 05:00:45 +0200 |
commit | 7b551ba7320bf45d60ec65d872aaab5a8a099550 (patch) | |
tree | 80645a8c83d06155c5b91a6db372b1f9d006e696 | |
parent | f41e7b14db222730e9ef6a5d60a133d2b19b7c08 (diff) | |
download | ffmpeg-7b551ba7320bf45d60ec65d872aaab5a8a099550.tar.gz |
avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
Reviewed-by: maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cd9ff4e3aa23318a855c21d60b1c9035b2b99d2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/libutvideodec.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp index e4b87a8bbc..93fbcb4a51 100644 --- a/libavcodec/libutvideodec.cpp +++ b/libavcodec/libutvideodec.cpp @@ -222,9 +222,19 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data, pic->data[0] = utv->buffer + utv->buf_size + pic->linesize[0]; break; } + pic->width = w; + pic->height = h; + pic->format = avctx->pix_fmt; + + if (avctx->refcounted_frames) { + int ret = av_frame_ref((AVFrame*)data, pic); + if (ret < 0) + return ret; + } else { + av_frame_move_ref((AVFrame*)data, pic); + } *got_frame = 1; - av_frame_move_ref((AVFrame*)data, pic); return avpkt->size; } |