diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-18 20:02:32 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-18 20:02:32 +0000 |
| commit | b23ffefb21e43f0dc9d1bf031156331ea56e474d (patch) | |
| tree | 7846bca674bdbece08d114644dd1c607cbab1833 /src/lib/ffmpeg_decoder.cc | |
| parent | a54bdb873641bbc84298f4424dba17a075d0c0da (diff) | |
Support non-planar float audio.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 911714d7b..3c607a7fb 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -438,7 +438,25 @@ FFmpegDecoder::deinterleave_audio (uint8_t* data, int size) } } } + break; + + case AV_SAMPLE_FMT_FLT: + { + float* p = reinterpret_cast<float*> (data); + int sample = 0; + int channel = 0; + for (int i = 0; i < total_samples; ++i) { + audio->data(channel)[sample] = *p++; + ++channel; + if (channel == _film->audio_channels()) { + channel = 0; + ++sample; + } + } + } + break; + case AV_SAMPLE_FMT_FLTP: { float* p = reinterpret_cast<float*> (data); |
