From 3da25c0d91a521c1c295a047c5442d54dc195238 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 13 Oct 2022 12:20:26 +0200 Subject: [PATCH] Fix stale detection with progress patch --- ffmpeg/parse/parser.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ffmpeg/parse/parser.go b/ffmpeg/parse/parser.go index 5f54d68a..0adb53d2 100644 --- a/ffmpeg/parse/parser.go +++ b/ffmpeg/parse/parser.go @@ -379,13 +379,12 @@ func (p *parser) Parse(line string) uint64 { } // Calculate if any of the processed frames staled. - // If one number of frames in an output is the same as - // before, then pFrames becomes 0. - var pFrames uint64 = 0 - - pFrames = p.stats.main.diff.frame + // If one number of frames in an output is the same as before, then pFrames becomes 0. + pFrames := p.stats.main.diff.frame if isFFmpegProgress { + // Only consider the outputs + pFrames = 1 for i := range p.stats.output { pFrames *= p.stats.output[i].diff.frame }