We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 243bb78 commit c908e9bCopy full SHA for c908e9b
src/AvTranscoder/decoder/AudioGenerator.cpp
@@ -38,6 +38,15 @@ void AudioGenerator::setNextFrame(Frame& inputFrame)
38
39
bool AudioGenerator::decodeNextFrame(Frame& frameBuffer)
40
{
41
+ // Check channel layout of the given frame to be able to copy audio data to it.
42
+ // @see Frame.copyData method
43
+ if(frameBuffer.getAVFrame().channel_layout == 0)
44
+ {
45
+ const size_t channelLayout = av_get_default_channel_layout(frameBuffer.getAVFrame().channels);
46
+ LOG_WARN("Channel layout en the audio frame is not set. Set it to '" << channelLayout << "' to be able to copy silence data.")
47
+ av_frame_set_channel_layout(&frameBuffer.getAVFrame(), channelLayout);
48
+ }
49
+
50
// Generate silent
51
if(!_inputFrame)
52
0 commit comments