diff mbox series

[FFmpeg-devel] ffmpeg: Do not exit if alleged error was only worth a debug information

Message ID CAB0OVGoarkiNJOVXfKkiDy8fJUwTnYFME_Wv+Bz3JDxHmiUM_w@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] ffmpeg: Do not exit if alleged error was only worth a debug information
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Carl Eugen Hoyos Jan. 15, 2020, 1:50 p.m. UTC
Hi!

Attached patch fixes hard-to-understand behaviour of ffmpeg for some
mp4 input files, a hard exit following a debug message.

Please comment, Carl Eugen

Comments

Marton Balint Jan. 15, 2020, 3:56 p.m. UTC | #1
On Wed, 15 Jan 2020, Carl Eugen Hoyos wrote:

> Hi!
>
> Attached patch fixes hard-to-understand behaviour of ffmpeg for some
> mp4 input files, a hard exit following a debug message.

I don't think such an mp4 file is strictly valid, therefore the behavior 
of the program should remain the same, it should exit.

It might make more sense to force an AV_LOG_ERROR level for the message if 
exit_on_error is set.

Regards,
Marton
diff mbox series

Patch

From b4b6d426fadacef4b1e912e8be6d06520093a955 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Wed, 15 Jan 2020 14:48:02 +0100
Subject: [PATCH] ffmpeg: Do not exit if alleged error was only worth a debug
 information.

Reported-by: Forum user NewPlaza
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6bcd7b94d2..c5be7fdfb6 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -783,7 +783,7 @@  static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
                 av_log(s, loglevel, "Non-monotonous DTS in output stream "
                        "%d:%d; previous: %"PRId64", current: %"PRId64"; ",
                        ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
-                if (exit_on_error) {
+                if (exit_on_error && loglevel > AV_LOG_DEBUG) {
                     av_log(NULL, AV_LOG_FATAL, "aborting.\n");
                     exit_program(1);
                 }
-- 
2.23.0