summaryrefslogtreecommitdiffstats
path: root/common/encode_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-12-07 19:44:29 +0100
committerwm4 <wm4@nowhere>2016-12-07 19:53:11 +0100
commit3eceac2eab0b42ee082a0b615ebf40a21f0fb915 (patch)
treea7f719897b49f44006d44a1efcdab3b8d203aad8 /common/encode_lavc.c
parenta660e15c9b96bd46209e78b3c3d4cf136a039a50 (diff)
downloadmpv-3eceac2eab0b42ee082a0b615ebf40a21f0fb915.tar.bz2
mpv-3eceac2eab0b42ee082a0b615ebf40a21f0fb915.tar.xz
Remove compatibility things
Possible with bumped FFmpeg/Libav. These are just the simple cases.
Diffstat (limited to 'common/encode_lavc.c')
-rw-r--r--common/encode_lavc.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/common/encode_lavc.c b/common/encode_lavc.c
index d0523857ee..7e116e3b0c 100644
--- a/common/encode_lavc.c
+++ b/common/encode_lavc.c
@@ -595,12 +595,7 @@ int encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
}
return -1;
}
-#if HAVE_AVCODEC_HAS_CODECPAR
ctx->vcc = avcodec_alloc_context3(ctx->vc);
-#else
- avcodec_get_context_defaults3(ctx->vst->codec, ctx->vc);
- ctx->vcc = ctx->vst->codec;
-#endif
// Using codec->time_base is deprecated, but needed for older lavf.
ctx->vst->time_base = ctx->timebase;
@@ -635,12 +630,7 @@ int encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
}
return -1;
}
-#if HAVE_AVCODEC_HAS_CODECPAR
ctx->acc = avcodec_alloc_context3(ctx->ac);
-#else
- avcodec_get_context_defaults3(ctx->ast->codec, ctx->ac);
- ctx->acc = ctx->ast->codec;
-#endif
// Using codec->time_base is deprecated, but needed for older lavf.
ctx->ast->time_base = ctx->timebase;
@@ -708,10 +698,8 @@ int encode_lavc_open_codec(struct encode_lavc_context *ctx,
}
ret = avcodec_open2(codec, ctx->vc, &ctx->voptions);
-#if HAVE_AVCODEC_HAS_CODECPAR
if (ret >= 0)
ret = avcodec_parameters_from_context(ctx->vst->codecpar, codec);
-#endif
// complain about all remaining options, then free the dict
for (de = NULL; (de = av_dict_get(ctx->voptions, "", de,
@@ -747,10 +735,8 @@ int encode_lavc_open_codec(struct encode_lavc_context *ctx,
}
ret = avcodec_open2(codec, ctx->ac, &ctx->aoptions);
-#if HAVE_AVCODEC_HAS_CODECPAR
if (ret >= 0)
ret = avcodec_parameters_from_context(ctx->ast->codecpar, codec);
-#endif
// complain about all remaining options, then free the dict
for (de = NULL; (de = av_dict_get(ctx->aoptions, "", de,
@@ -826,11 +812,7 @@ int encode_lavc_write_frame(struct encode_lavc_context *ctx, AVStream *stream,
(int)packet->size);
-#if HAVE_AVCODEC_HAS_CODECPAR
switch (stream->codecpar->codec_type) {
-#else
- switch (stream->codec->codec_type) {
-#endif
case AVMEDIA_TYPE_VIDEO:
ctx->vbytes += packet->size;
++ctx->frames;