summaryrefslogtreecommitdiffstats
path: root/video/out/vo_lavc.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vo_lavc.c')
-rw-r--r--video/out/vo_lavc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index ca3f1c5a5f..ffc565f0bf 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -278,7 +278,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
{
struct priv *vc = vo->priv;
struct encode_lavc_context *ectx = vo->encode_lavc_ctx;
- int i, size;
+ int size;
AVFrame *frame;
AVCodecContext *avc;
int64_t frameipts;
@@ -428,10 +428,11 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
frame->pts = av_rescale_q(vc->lastipts + skipframes,
vc->worst_time_base, avc->time_base);
- for (i = 0; i < 4; i++) {
- frame->data[i] = vc->lastimg->planes[i];
- frame->linesize[i] = vc->lastimg->stride[i];
- }
+ enum AVPictureType savetype = frame->pict_type;
+ mp_image_copy_fields_to_av_frame(frame, vc->lastimg);
+ frame->pict_type = savetype;
+ // keep this at avcodec_get_frame_defaults default
+
frame->quality = avc->global_quality;
av_init_packet(&packet);