summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-16 12:57:14 +0100
committerwm4 <wm4@nowhere>2014-03-16 13:19:29 +0100
commit62c88a52c482c9e4df207be8176023a868b29377 (patch)
tree641dbad8d5d22b6162d978146fe77175c329a6a5 /video
parent62ab6a91bdde3cdc2ed526a35994ecaeef66b80d (diff)
downloadmpv-62c88a52c482c9e4df207be8176023a868b29377.tar.bz2
mpv-62c88a52c482c9e4df207be8176023a868b29377.tar.xz
encode: use new AVFrame API
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_lavc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index b5176ebcb4..22373c9781 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -282,7 +282,6 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
struct priv *vc = vo->priv;
struct encode_lavc_context *ectx = vo->encode_lavc_ctx;
int size;
- AVFrame *frame;
AVCodecContext *avc;
int64_t frameipts;
double nextpts;
@@ -407,7 +406,6 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
}
if (vc->lastipts != MP_NOPTS_VALUE) {
- frame = avcodec_alloc_frame();
// we have a valid image in lastimg
while (vc->lastipts < frameipts) {
@@ -424,7 +422,7 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
skipframes = 0;
if (thisduration > skipframes) {
- avcodec_get_frame_defaults(frame);
+ AVFrame *frame = av_frame_alloc();
// this is a nop, unless the worst time base is the STREAM time base
frame->pts = av_rescale_q(vc->lastipts + skipframes,
@@ -444,12 +442,12 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
write_packet(vo, size, &packet);
++vc->lastdisplaycount;
vc->lastencodedipts = vc->lastipts + skipframes;
+
+ av_frame_free(&frame);
}
vc->lastipts += thisduration;
}
-
- avcodec_free_frame(&frame);
}
if (!mpi) {