aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorViliam Mateicka <viliam.mateicka@gmail.com>2009-03-02 20:07:19 +0100
committerMax Kellermann <max@duempel.org>2009-03-02 20:12:36 +0100
commit8694574f6329ad6e55b9a6673506eca697da360d (patch)
treed66ed5f01de1a28a201c19afc4cc424a86862c1f /src/decoder
parent60a5b5562b6608ffe2e1ee5b9e83365cdcd83c06 (diff)
downloadmpd-8694574f6329ad6e55b9a6673506eca697da360d.tar.gz
mpd-8694574f6329ad6e55b9a6673506eca697da360d.tar.xz
mpd-8694574f6329ad6e55b9a6673506eca697da360d.zip
ffmpeg: use ffmpeg's sampleformat for output format
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/ffmpeg_plugin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c
index b24685980..02a1f836b 100644
--- a/src/decoder/ffmpeg_plugin.c
+++ b/src/decoder/ffmpeg_plugin.c
@@ -273,7 +273,12 @@ ffmpeg_decode_internal(struct ffmpeg_context *ctx)
codec_context->channels = 2;
}
- audio_format.bits = (uint8_t)16;
+#if LIBAVCODEC_VERSION_INT > ((51<<16)+(41<<8)+0)
+ audio_format.bits = (uint8_t) av_get_bits_per_sample_format(codec_context->sample_fmt);
+#else
+ /* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */
+ audio_format.bits = (uint8_t) 16;
+#endif
audio_format.sample_rate = (unsigned int)codec_context->sample_rate;
audio_format.channels = codec_context->channels;