summaryrefslogtreecommitdiffstats
path: root/video/out/vo_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-15 15:45:34 +0200
committerwm4 <wm4@nowhere>2016-04-15 15:45:38 +0200
commita77cbc504ac3ff359d4c029e3c1b34581e7c7caa (patch)
tree897d3255054b9237f2f44029e97b2c6b63d33c5d /video/out/vo_lavc.c
parent798188cb33adebf2a3c4ea44918f8afef1c8f17b (diff)
downloadmpv-a77cbc504ac3ff359d4c029e3c1b34581e7c7caa.tar.bz2
mpv-a77cbc504ac3ff359d4c029e3c1b34581e7c7caa.tar.xz
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.
Diffstat (limited to 'video/out/vo_lavc.c')
-rw-r--r--video/out/vo_lavc.c35
1 files changed, 12 insertions, 23 deletions
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)