aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-15 11:47:49 +0100
committerMax Kellermann <max@duempel.org>2014-01-15 11:47:49 +0100
commit5fb72d7c8fd2d80af1e19b835b95b1e886905242 (patch)
tree2e16d6f70eb5821b3f027bfaae787240a1ad837c /src/decoder
parentf1ca17f6a1a8a04016ceb31e799cc0504729322b (diff)
parent313d1d5d8379ce8c0763f43775e767832942a7ef (diff)
downloadmpd-5fb72d7c8fd2d80af1e19b835b95b1e886905242.tar.gz
mpd-5fb72d7c8fd2d80af1e19b835b95b1e886905242.tar.xz
mpd-5fb72d7c8fd2d80af1e19b835b95b1e886905242.zip
Merge branch 'v0.18.x'
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/FfmpegDecoderPlugin.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 7b827da27..0d4256bd9 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -38,6 +38,10 @@ extern "C" {
#include <libavutil/avutil.h>
#include <libavutil/log.h>
#include <libavutil/mathematics.h>
+
+#if LIBAVUTIL_VERSION_MAJOR >= 53
+#include <libavutil/frame.h>
+#endif
}
#include <assert.h>
@@ -453,7 +457,11 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
decoder_initialized(decoder, audio_format,
input.seekable, total_time);
+#if LIBAVUTIL_VERSION_MAJOR >= 53
+ AVFrame *frame = av_frame_alloc();
+#else
AVFrame *frame = avcodec_alloc_frame();
+#endif
if (!frame) {
LogError(ffmpeg_domain, "Could not allocate frame");
avformat_close_input(&format_context);
@@ -497,7 +505,9 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
}
} while (cmd != DecoderCommand::STOP);
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
+#if LIBAVUTIL_VERSION_MAJOR >= 53
+ av_frame_free(&frame);
+#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
avcodec_free_frame(&frame);
#else
av_freep(&frame);