Hopefully support signed 32-bit planar audio.
authorCarl Hetherington <cth@carlh.net>
Tue, 15 Mar 2016 11:20:40 +0000 (11:20 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 15 Mar 2016 11:20:40 +0000 (11:20 +0000)
src/lib/ffmpeg_decoder.cc

index 72845a133eb0b11be7a5cfc307e0d0d5ef4addd4..8f97cb2c16a3f17b5d3b56841b9dfecb5f94efd5 100644 (file)
@@ -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]);