File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -1276,20 +1276,16 @@ void SingleStreamDecoder::convertAudioAVFrameToFrameOutputOnCPU(
12761276 int outSampleRate =
12771277 streamInfo.audioStreamOptions .sampleRate .value_or (srcSampleRate);
12781278
1279- int srcNumChannels = getNumChannels (srcAVFrame);
1280- int srcNumChannelsFromCodec = getNumChannels (streamInfo.codecContext );
1281- // Use number of channels from codec if 0 returned from frame
1282- if (srcNumChannels == 0 && srcNumChannelsFromCodec > 0 ) {
1283- srcNumChannels = srcNumChannelsFromCodec;
1284- } else {
1285- // Check if the number of channels from the frame matches the codec
1286- TORCH_CHECK (
1287- srcNumChannels == srcNumChannelsFromCodec,
1288- " The frame has " ,
1289- srcNumChannels,
1290- " channels, expected " ,
1291- srcNumChannelsFromCodec);
1292- };
1279+ int srcNumChannels = getNumChannels (streamInfo.codecContext );
1280+ TORCH_CHECK (
1281+ srcNumChannels == getNumChannels (srcAVFrame),
1282+ " The frame has " ,
1283+ getNumChannels (srcAVFrame),
1284+ " channels, expected " ,
1285+ srcNumChannels,
1286+ " . If you are hitting this, it may be because you are using "
1287+ " a buggy FFmpeg version. FFmpeg4 is known to fail here in some "
1288+ " valid scenarios. Try to upgrade FFmpeg?" );
12931289 int outNumChannels =
12941290 streamInfo.audioStreamOptions .numChannels .value_or (srcNumChannels);
12951291
You can’t perform that action at this time.
0 commit comments