Commit 8694574f authored by Viliam Mateicka's avatar Viliam Mateicka Committed by Max Kellermann

ffmpeg: use ffmpeg's sampleformat for output format

parent 60a5b556
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment