From 51fe8549e6364e8d685dd4e5c3a1f5de2fda50d3 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Fri, 5 Jun 2020 17:53:21 -0500 Subject: [PATCH] Fix regression caused by Codacy tweaks --- src/FFmpegWriter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp index 7eb24156c..5a21c6ba4 100644 --- a/src/FFmpegWriter.cpp +++ b/src/FFmpegWriter.cpp @@ -985,6 +985,9 @@ void FFmpegWriter::flush_encoders() { if (error_code < 0) { ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::flush_encoders ERROR [" + (std::string)av_err2str(error_code) + "]", "error_code", error_code); } + if (!got_packet) { + break; + } // Since the PTS can change during encoding, set the value again. This seems like a huge hack, // but it fixes lots of PTS related issues when I do this.