Skip to content

Commit 7d643f2

Browse files
committed
Fix FFmpeg 5.X?
1 parent 2d76a7b commit 7d643f2

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/torchcodec/_core/Encoder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ void AudioEncoder::initializeEncoder(
179179

180180
desiredNumChannels_ = static_cast<int>(numChannels.value_or(wf_.sizes()[0]));
181181
validateNumChannels(*avCodec, desiredNumChannels_);
182-
183182
setDefaultChannelLayout(avCodecContext_, desiredNumChannels_);
184183

185184
validateSampleRate(*avCodec, sampleRate);

src/torchcodec/_core/FFMPEGCommon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void setDefaultChannelLayout(UniqueAVFrame& avFrame, int numChannels) {
101101
}
102102

103103
void validateNumChannels(const AVCodec& avCodec, int numChannels) {
104-
#if LIBAVFILTER_VERSION_MAJOR > 8 // FFmpeg > 5
104+
#if LIBAVFILTER_VERSION_MAJOR > 7 // FFmpeg > 4
105105
if (avCodec.ch_layouts == nullptr) {
106106
// If we can't validate, we must assume it'll be fine. If not, FFmpeg will
107107
// eventually raise.

0 commit comments

Comments
 (0)