summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-08-23 10:14:59 +0200
committerMax Kellermann <max@musicpd.org>2016-08-23 10:15:54 +0200
commit4204d4928be664377385f679b7c0915133238ade (patch)
tree604cde6509ce6e7343af7ff5bd421e00e018b285
parent05de0ecec3ef32a04ffcf91fe7c690529735d59f (diff)
decoder/ffmpeg: no avcodec_parameters_to_context() with FFmpeg 3.0
This function exists since FFmpeg 3.1. Fix a build failure with FFmpeg 3.0.
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index ca1f3c0f8..e27ec797f 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -548,8 +548,10 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
avcodec_free_context(&codec_context);
};
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 25, 0) /* FFmpeg 3.1 */
avcodec_parameters_to_context(codec_context, av_stream.codecpar);
#endif
+#endif
const SampleFormat sample_format =
ffmpeg_sample_format(GetSampleFormat(codec_params));