From a77cbc504ac3ff359d4c029e3c1b34581e7c7caa Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 15 Apr 2016 15:45:34 +0200 Subject: vo_lavc: unsupport deprecated AVFMT_RAWPICTURE As of ffmpeg git master, only the libavdevice decklink wrapper supports this. Everything else has dropped support. You're now supposed to use AV_CODEC_ID_WRAPPED_AVFRAME, which works a bit differently. Normal AVFrames should still work for these encoders. --- video/out/vo_lavc.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'video/out/vo_lavc.c') diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c index 6573e1d8a8..4f70c2b2ed 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -250,30 +250,19 @@ static void write_packet(struct vo *vo, int size, AVPacket *packet) static int encode_video(struct vo *vo, AVFrame *frame, AVPacket *packet) { struct priv *vc = vo->priv; - if (encode_lavc_oformat_flags(vo->encode_lavc_ctx) & AVFMT_RAWPICTURE) { - if (!frame) - return 0; - memcpy(vc->buffer, frame, sizeof(AVPicture)); - MP_DBG(vo, "got pts %f\n", + int got_packet = 0; + int status = avcodec_encode_video2(vc->codec, packet, + frame, &got_packet); + int size = (status < 0) ? status : got_packet ? packet->size : 0; + + if (frame) + MP_DBG(vo, "got pts %f; out size: %d\n", frame->pts * (double) vc->codec->time_base.num / - (double) vc->codec->time_base.den); - packet->size = sizeof(AVPicture); - return packet->size; - } else { - int got_packet = 0; - int status = avcodec_encode_video2(vc->codec, packet, - frame, &got_packet); - int size = (status < 0) ? status : got_packet ? packet->size : 0; - - if (frame) - MP_DBG(vo, "got pts %f; out size: %d\n", - frame->pts * (double) vc->codec->time_base.num / - (double) vc->codec->time_base.den, size); - - if (got_packet) - encode_lavc_write_stats(vo->encode_lavc_ctx, vc->codec); - return size; - } + (double) vc->codec->time_base.den, size); + + if (got_packet) + encode_lavc_write_stats(vo->encode_lavc_ctx, vc->codec); + return size; } static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi) -- cgit v1.2.3