aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq1enc.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/svq1enc.c
parent6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff)
downloadffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/svq1enc.c')
-rw-r--r--libavcodec/svq1enc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index e654b4ecb3..22668958a9 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -324,9 +324,9 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
s->m.current_picture.mb_mean = (uint8_t *)s->dummy;
s->m.current_picture.mb_var = (uint16_t *)s->dummy;
s->m.current_picture.mc_mb_var = (uint16_t *)s->dummy;
- s->m.current_picture.f.mb_type = s->dummy;
+ s->m.current_picture.mb_type = s->dummy;
- s->m.current_picture.f.motion_val[0] = s->motion_val8[plane] + 2;
+ s->m.current_picture.motion_val[0] = s->motion_val8[plane] + 2;
s->m.p_mv_table = s->motion_val16[plane] +
s->m.mb_stride + 1;
s->m.dsp = s->dsp; // move
@@ -550,8 +550,8 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
if (!s->current_picture.data[0]) {
- ff_get_buffer(avctx, &s->current_picture);
- ff_get_buffer(avctx, &s->last_picture);
+ ff_get_buffer(avctx, &s->current_picture, 0);
+ ff_get_buffer(avctx, &s->last_picture, 0);
s->scratchbuf = av_malloc(s->current_picture.linesize[0] * 16 * 2);
}
@@ -613,6 +613,9 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
av_freep(&s->motion_val16[i]);
}
+ av_frame_unref(&s->current_picture);
+ av_frame_unref(&s->last_picture);
+
return 0;
}