aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tiertexseqv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-21 21:34:46 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 07:38:30 +0100
commit759001c534287a96dc96d1e274665feb7059145d (patch)
tree6ace9560c20aa30db92067c5b45d7bd86e458d10 /libavcodec/tiertexseqv.c
parent6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff)
downloadffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/tiertexseqv.c')
-rw-r--r--libavcodec/tiertexseqv.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c
index a9064eca24..5d5d69434b 100644
--- a/libavcodec/tiertexseqv.c
+++ b/libavcodec/tiertexseqv.c
@@ -27,6 +27,7 @@
#include "avcodec.h"
#define BITSTREAM_READER_LE
#include "get_bits.h"
+#include "internal.h"
typedef struct SeqVideoContext {
@@ -227,21 +228,21 @@ static int seqvideo_decode_frame(AVCodecContext *avctx,
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
+ int ret;
SeqVideoContext *seq = avctx->priv_data;
- seq->frame.reference = 1;
- seq->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &seq->frame)) {
+ if ((ret = ff_reget_buffer(avctx, &seq->frame)) < 0) {
av_log(seq->avctx, AV_LOG_ERROR, "tiertexseqvideo: reget_buffer() failed\n");
- return -1;
+ return ret;
}
if (seqvideo_decode(seq, buf, buf_size))
return AVERROR_INVALIDDATA;
+ if ((ret = av_frame_ref(data, &seq->frame)) < 0)
+ return ret;
*got_frame = 1;
- *(AVFrame *)data = seq->frame;
return buf_size;
}
@@ -250,8 +251,7 @@ static av_cold int seqvideo_decode_end(AVCodecContext *avctx)
{
SeqVideoContext *seq = avctx->priv_data;
- if (seq->frame.data[0])
- avctx->release_buffer(avctx, &seq->frame);
+ av_frame_unref(&seq->frame);
return 0;
}