summaryrefslogtreecommitdiff
path: root/libavcodec/rv10.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/rv10.c
parent6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff)
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r--libavcodec/rv10.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index c3e977a760..7fd4ddfa42 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -644,7 +644,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MpegEncContext *s = avctx->priv_data;
- int i;
+ int i, ret;
AVFrame *pict = data;
int slice_count;
const uint8_t *slices_hdr = NULL;
@@ -701,14 +701,17 @@ static int rv10_decode_frame(AVCodecContext *avctx,
ff_MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *pict = s->current_picture_ptr->f;
+ if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ return ret;
+ ff_print_debug_info(s, s->current_picture_ptr);
} else if (s->last_picture_ptr != NULL) {
- *pict = s->last_picture_ptr->f;
+ if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
+ return ret;
+ ff_print_debug_info(s, s->last_picture_ptr);
}
if(s->last_picture_ptr || s->low_delay){
*got_frame = 1;
- ff_print_debug_info(s, pict);
}
s->current_picture_ptr= NULL; // so we can detect if frame_end was not called (find some nicer solution...)
}