aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libutvideodec.cpp
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-03-24 20:55:30 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-03-26 21:52:48 +0100
commit2d0e415482caa0bac1728f23efedad975314ac28 (patch)
tree751f7425711dfc8826a6f805e9fc08b3de345939 /libavcodec/libutvideodec.cpp
parentdaa6dc0a3b398f7bc36af683cb2f6d7ba186e015 (diff)
downloadffmpeg-2d0e415482caa0bac1728f23efedad975314ac28.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>
Diffstat (limited to 'libavcodec/libutvideodec.cpp')
-rw-r--r--libavcodec/libutvideodec.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp
index 7c60f4fb83..a456735d3c 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;
}