Remove incorrect silencing (#2526).
authorCarl Hetherington <cth@carlh.net>
Thu, 11 May 2023 01:24:57 +0000 (03:24 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 11 May 2023 08:40:20 +0000 (10:40 +0200)
On switching to the new FFmpeg send/receive API in
e29ce33a36c2e20444d57196defc86d5072bce81
the channels variable in deinterleave_audio() was switched from
stream channels to frame channels.

I'm not sure if this is right, but it does mean that audio has
`channels` channels, so calling make_silent() up to the stream
channel count is clearly wrong if the stream has more channels
than the frame.

src/lib/ffmpeg_decoder.cc

index 85f79b513664f28f01640662b998d541ffcdde4a..9f505ea4303d8a4685c213b468a8335bb0a6b35a 100644 (file)
@@ -361,13 +361,9 @@ deinterleave_audio(shared_ptr<FFmpegAudioStream> stream, AVFrame* frame)
        {
                auto p = reinterpret_cast<float**> (frame->data);
                DCPOMATIC_ASSERT(channels <= stream->channels());
-               /* Sometimes there aren't as many channels in the frame as in the stream */
                for (int i = 0; i < channels; ++i) {
                        memcpy (data[i], p[i], frames * sizeof(float));
                }
-               for (int i = channels; i < stream->channels(); ++i) {
-                       audio->make_silent (i);
-               }
        }
        break;