From 08c1fcea92d63cde6aa8b55c21b5e858f1af0e4d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 15 Mar 2016 11:20:40 +0000 Subject: [PATCH] Hopefully support signed 32-bit planar audio. --- src/lib/ffmpeg_decoder.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 72845a133..8f97cb2c1 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -218,6 +218,17 @@ FFmpegDecoder::deinterleave_audio (shared_ptr stream) const } break; + case AV_SAMPLE_FMT_S32P: + { + int32_t** p = reinterpret_cast (_frame->data); + for (int i = 0; i < stream->channels(); ++i) { + for (int j = 0; j < frames; ++j) { + audio->data(i)[j] = static_cast(p[i][j]) / (1 << 31); + } + } + } + break; + case AV_SAMPLE_FMT_FLT: { float* p = reinterpret_cast (_frame->data[0]); -- 2.30.2