summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-03-15 11:20:40 +0000
committerCarl Hetherington <cth@carlh.net>2016-03-15 11:20:40 +0000
commit08c1fcea92d63cde6aa8b55c21b5e858f1af0e4d (patch)
tree8a6e4007f47905f860b1b2a1090a6854a96145e5
parentb122a880e58fb0c3fa2300ad6eff3be8cdd386e1 (diff)
Hopefully support signed 32-bit planar audio.
-rw-r--r--src/lib/ffmpeg_decoder.cc11
1 files changed, 11 insertions, 0 deletions
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<FFmpegAudioStream> stream) const
}
break;
+ case AV_SAMPLE_FMT_S32P:
+ {
+ int32_t** p = reinterpret_cast<int32_t **> (_frame->data);
+ for (int i = 0; i < stream->channels(); ++i) {
+ for (int j = 0; j < frames; ++j) {
+ audio->data(i)[j] = static_cast<float>(p[i][j]) / (1 << 31);
+ }
+ }
+ }
+ break;
+
case AV_SAMPLE_FMT_FLT:
{
float* p = reinterpret_cast<float*> (_frame->data[0]);