Commit 21caca4a authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: use avcodec_open2() on newer ffmpeg versions

avcodec_open() has been deprecated.
parent fbf3edf0
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment