diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-09-19 23:08:32 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-12-22 10:30:21 +0100 |
commit | 314269118161ed7735a905332ccf847d1ec696a2 (patch) | |
tree | daabdba2d8867cd71fdc6a4eb3c4e95d0a077a0e /libavformat/wavdec.c | |
parent | 95fb9e0205921a9970fb1a418a12e7f01c18cbca (diff) | |
download | ffmpeg-314269118161ed7735a905332ccf847d1ec696a2.tar.gz |
avformat/wavdec: add support for decoding 24.0 and 16.8 floating point pcm formats
Fixes #5602 and #5603.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r-- | libavformat/wavdec.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index ae42a6167f..987155e39e 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -556,6 +556,19 @@ break_loop: if (sample_count) st->duration = sample_count; + if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S32LE && + st->codecpar->block_align == st->codecpar->channels * 4 && + st->codecpar->bits_per_coded_sample == 32 && + st->codecpar->extradata_size == 2 && + AV_RL16(st->codecpar->extradata) == 1) { + st->codecpar->codec_id = AV_CODEC_ID_PCM_F16LE; + st->codecpar->bits_per_coded_sample = 16; + } else if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S24LE && + st->codecpar->block_align == st->codecpar->channels * 4 && + st->codecpar->bits_per_coded_sample == 24) { + st->codecpar->codec_id = AV_CODEC_ID_PCM_F24LE; + } + ff_metadata_conv_ctx(s, NULL, wav_metadata_conv); ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv); |