aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/ffmpeg_decoder_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-05 14:55:19 +0200
committerMax Kellermann <max@duempel.org>2012-10-05 15:24:53 +0200
commitfd016f45074cc5afd114163fb2d9390022e2e7d5 (patch)
treed0f34204e9412f2a01920fc1030de58941928122 /src/decoder/ffmpeg_decoder_plugin.c
parent9d728b365da7693c906f9eb95744e282bb4e834a (diff)
downloadmpd-fd016f45074cc5afd114163fb2d9390022e2e7d5.tar.gz
mpd-fd016f45074cc5afd114163fb2d9390022e2e7d5.tar.xz
mpd-fd016f45074cc5afd114163fb2d9390022e2e7d5.zip
decoder/ffmpeg: show unsupported sample format name
Use av_get_sample_fmt_string() to obtain a human-readable string.
Diffstat (limited to '')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index c9389b866..bab6968e8 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -376,10 +376,21 @@ ffmpeg_sample_format(enum AVSampleFormat sample_fmt)
return SAMPLE_FORMAT_S32;
default:
+ break;
+ }
+
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 1)
+ char buffer[64];
+ const char *name = av_get_sample_fmt_string(buffer, sizeof(buffer),
+ sample_fmt);
+ if (name != NULL)
+ g_warning("Unsupported libavcodec SampleFormat value: %s (%d)",
+ name, sample_fmt);
+ else
+#endif
g_warning("Unsupported libavcodec SampleFormat value: %d",
sample_fmt);
- return SAMPLE_FORMAT_UNDEFINED;
- }
+ return SAMPLE_FORMAT_UNDEFINED;
}
static AVInputFormat *