From f497731260d42e920318ca745a8146febb9e055e Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 8 Nov 2021 19:24:57 +0100 Subject: [PATCH] fftools/ffmpeg_opt: Apply copyinkf for all stream types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The earlier code has ignored it for all stream types except video and subtitles, probably because audio was presumed to only consist of keyframes. Yet this assumption is not true for e.g. TrueHD. Reviewed-by: Jan Ekström Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg_opt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 50f0edd332..f983c74a66 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1611,6 +1611,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e if (!ost->muxing_queue) exit_program(1); + MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, + ost->copy_initial_nonkeyframes, oc, st); + return ost; } @@ -1917,8 +1920,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in ost->last_frame = av_frame_alloc(); if (!ost->last_frame) exit_program(1); - } else { - MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st); } if (ost->stream_copy) @@ -2046,8 +2047,6 @@ static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; - MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc, st); - if (!ost->stream_copy) { char *frame_size = NULL;