summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-11 09:57:08 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-17 12:01:40 +0200
commit4358d4d8e71bc5ff205f43daac8448fc4953c794 (patch)
tree88232c1a58430f8672abf660f54f3cfac42e568e /fftools/ffmpeg_enc.c
parent4fc513b5e379dc4d45c8aa23af7d580708bbe4d9 (diff)
downloadffmpeg-4358d4d8e71bc5ff205f43daac8448fc4953c794.tar.gz
fftools/ffmpeg: move a check to a more appropriate place
reap_filters() no longer needs to access the encoding context.
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r--fftools/ffmpeg_enc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 0236e50e38..063053623f 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -789,6 +789,13 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
AVCodecContext *enc = ost->enc_ctx;
int ret;
+ if (!(enc->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE) &&
+ enc->ch_layout.nb_channels != frame->ch_layout.nb_channels) {
+ av_log(ost, AV_LOG_ERROR,
+ "Audio channel count changed and encoder does not support parameter changes\n");
+ return;
+ }
+
if (frame->pts == AV_NOPTS_VALUE)
frame->pts = e->next_pts;
else {