From 5d9876e33825e3ce526e480dc5311073078aba64 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 Feb 2012 09:55:25 +0100 Subject: decoder/ffmpeg: use AV_SAMPLE_FMT_* if available Implements support for libavcodec 0.9, which removes the compatibility macros SAMPLE_FMT_* --- NEWS | 2 +- src/decoder/ffmpeg_decoder_plugin.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 67d29a0e0..803428bd1 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ ver 0.16.7 (2011/??/??) * input: - ffmpeg: support libavformat 0.7 * decoder: - - ffmpeg: support libavformat 0.8, libavcodec 0.8 + - ffmpeg: support libavformat 0.8, libavcodec 0.9 - ffmpeg: support all MPD tags * output: - httpd: fix excessive buffering diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index b3c3744a1..52632dc4a 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -371,10 +371,18 @@ ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context) { #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(51, 41, 0) switch (codec_context->sample_fmt) { +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 1) + case AV_SAMPLE_FMT_S16: +#else case SAMPLE_FMT_S16: +#endif return SAMPLE_FORMAT_S16; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 1) + case AV_SAMPLE_FMT_S32: +#else case SAMPLE_FMT_S32: +#endif return SAMPLE_FORMAT_S32; default: -- cgit v1.2.3