]> git.sesse.net Git - nageru/commitdiff
Fix an audio encoder issue with newer FFmpeg.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 3 Sep 2021 16:10:46 +0000 (18:10 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 3 Sep 2021 16:13:02 +0000 (18:13 +0200)
nageru/audio_encoder.cpp

index 0f7f9aac8c957e3d686c87daa863719d102982d1..b236c002e7df44288651c7e6557afbb35844dcc7 100644 (file)
@@ -110,6 +110,7 @@ void AudioEncoder::encode_audio_one_frame(const float *audio, size_t num_samples
 {
        audio_frame->pts = audio_pts;
        audio_frame->nb_samples = num_samples;
 {
        audio_frame->pts = audio_pts;
        audio_frame->nb_samples = num_samples;
+       audio_frame->channels = 2;
        audio_frame->channel_layout = AV_CH_LAYOUT_STEREO;
        audio_frame->format = ctx->sample_fmt;
        audio_frame->sample_rate = OUTPUT_FREQUENCY;
        audio_frame->channel_layout = AV_CH_LAYOUT_STEREO;
        audio_frame->format = ctx->sample_fmt;
        audio_frame->sample_rate = OUTPUT_FREQUENCY;