summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-15 15:43:46 +0200
committerwm4 <wm4@nowhere>2016-04-15 15:43:46 +0200
commit798188cb33adebf2a3c4ea44918f8afef1c8f17b (patch)
tree422178aeff409054154de30c1be51a94e45d5b85 /video/out
parentd04aa5ef4e12f5bee3343e833e1209774e9204d9 (diff)
downloadmpv-798188cb33adebf2a3c4ea44918f8afef1c8f17b.tar.bz2
mpv-798188cb33adebf2a3c4ea44918f8afef1c8f17b.tar.xz
vo_lavc: send refcounted AVFrame to encoder
This potentially makes it more efficient, and actually makes it simpler. Yes, AV_PICTURE_TYPE_NONE is the default for pict_type.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_lavc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index d102fec869..6573e1d8a8 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -421,15 +421,15 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
skipframes = 0;
if (thisduration > skipframes) {
- AVFrame *frame = av_frame_alloc();
+ AVFrame *frame = mp_image_to_av_frame(vc->lastimg);
+ if (!frame)
+ abort();
// this is a nop, unless the worst time base is the STREAM time base
frame->pts = av_rescale_q(vc->lastipts + skipframes,
vc->worst_time_base, avc->time_base);
- enum AVPictureType savetype = frame->pict_type;
- mp_image_copy_fields_to_av_frame(frame, vc->lastimg);
- frame->pict_type = savetype;
+ frame->pict_type = AV_PICTURE_TYPE_NONE;
// keep this at avcodec_get_frame_defaults default
frame->quality = avc->global_quality;