aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index 6a746f94a..de545bded 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -433,7 +433,12 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
values into AVCodecContext.channels - a change that will be
reverted later by avcodec_decode_audio3() */
- if (avcodec_open(codec_context, codec)<0) {
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,6,0)
+ const int open_result = avcodec_open2(codec_context, codec, NULL);
+#else
+ const int open_result = avcodec_open(codec_context, codec);
+#endif
+ if (open_result < 0) {
g_warning("Could not open codec\n");
av_close_input_stream(format_context);
mpd_ffmpeg_stream_close(stream);