Fix T88614: Mixdown crashes Blender 2.92.0 and 3.0.0 Alpha

The problem is caused by the most recent ffmpeg version (4.4) which
needs channels to be set when submitting a frame for encoding.
This commit is contained in:
Joerg Mueller 2021-05-27 19:05:17 +02:00
parent dfa3dcbab9
commit 530f2994e9
Notes: blender-bot 2023-02-14 01:57:12 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #88614, Mixdown crashes Blender 2.92.0 and 3.0.0 Alpha
1 changed files with 1 additions and 0 deletions

View File

@ -75,6 +75,7 @@ void FFMPEGWriter::encode()
m_frame->nb_samples = m_input_samples;
m_frame->format = m_codecCtx->sample_fmt;
m_frame->channel_layout = m_codecCtx->channel_layout;
m_frame->channels = m_specs.channels;
if(avcodec_fill_audio_frame(m_frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
AUD_THROW(FileException, "File couldn't be written, filling the audio frame failed with ffmpeg.");