diff options
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index c25efa463..c1448ad90 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -225,9 +225,13 @@ FFmpegDecoder::deinterleave_audio (shared_ptr<FFmpegAudioStream> stream, uint8_t case AV_SAMPLE_FMT_FLTP: { float** p = reinterpret_cast<float**> (data); - for (int i = 0; i < stream->channels(); ++i) { + /* Sometimes there aren't as many channels in the _frame as in the stream */ + for (int i = 0; i < _frame->channels; ++i) { memcpy (audio->data(i), p[i], frames * sizeof(float)); } + for (int i = _frame->channels; i < stream->channels(); ++i) { + audio->make_silent (i); + } } break; |
