This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit b14162c9d43262e35ed9462f8534ec5236300819 Author: James Almer <[email protected]> AuthorDate: Mon Feb 10 23:14:05 2025 -0300 Commit: James Almer <[email protected]> CommitDate: Thu Aug 13 11:04:44 2026 -0300 fftools/ffmpeg_enc: split off encoder flushing in encoder_thread() into a separate function Preparation work for the following commits. Signed-off-by: James Almer <[email protected]> --- fftools/ffmpeg_enc.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 3205ff4f30..1fe43ae314 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -859,6 +859,19 @@ fail: return AVERROR(ENOMEM); } +static int flush_encoder(OutputStream *ost, EncoderThread *et) +{ + Encoder *e = ost->enc; + int ret; + + ret = frame_encode(ost, NULL, et->pkt); + if (ret < 0 && ret != AVERROR_EOF) + av_log(e, AV_LOG_ERROR, "Error flushing encoder: %s\n", + av_err2str(ret)); + + return ret; +} + int encoder_thread(void *arg) { OutputStream *ost = arg; @@ -924,12 +937,8 @@ int encoder_thread(void *arg) } // flush the encoder - if (ret == 0 || ret == AVERROR_EOF) { - ret = frame_encode(ost, NULL, et.pkt); - if (ret < 0 && ret != AVERROR_EOF) - av_log(e, AV_LOG_ERROR, "Error flushing encoder: %s\n", - av_err2str(ret)); - } + if (ret == 0 || ret == AVERROR_EOF) + ret = flush_encoder(ost, &et); // EOF is normal thread termination if (ret == AVERROR_EOF) _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
