aboutsummaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-05 15:14:57 +0200
committerMax Kellermann <max@duempel.org>2012-10-05 15:14:57 +0200
commit9d728b365da7693c906f9eb95744e282bb4e834a (patch)
treee746a3ae8bef22e0ab57531cb7e2003270e886f6 /src/decoder
parentddc028333902bccd0b12f3834fdb63c4307ed530 (diff)
decoder/ffmpeg: pass AVSampleFormat to ffmpeg_sample_format()
API simplification.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index cbc23f54..c9389b86 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -352,10 +352,15 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
return cmd;
}
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 94, 1)
+#define AVSampleFormat SampleFormat
+#endif
+
+G_GNUC_CONST
static enum sample_format
-ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context)
+ffmpeg_sample_format(enum AVSampleFormat sample_fmt)
{
- switch (codec_context->sample_fmt) {
+ switch (sample_fmt) {
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 1)
case AV_SAMPLE_FMT_S16:
#else
@@ -372,7 +377,7 @@ ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context)
default:
g_warning("Unsupported libavcodec SampleFormat value: %d",
- codec_context->sample_fmt);
+ sample_fmt);
return SAMPLE_FORMAT_UNDEFINED;
}
}
@@ -486,7 +491,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
}
const enum sample_format sample_format =
- ffmpeg_sample_format(codec_context);
+ ffmpeg_sample_format(codec_context->sample_fmt);
if (sample_format == SAMPLE_FORMAT_UNDEFINED)
return;