[FFmpeg-devel] Display statistics on decode error

Submitted by =?UTF-8?q?R=C3=A9mi=20Achard?= on July 12, 2019, 1:24 p.m.

Details

Message ID 20190712132415.6948-1-remi.achard@ymagis.com
State New
Headers show

Commit Message

=?UTF-8?q?R=C3=A9mi=20Achard?= July 12, 2019, 1:24 p.m.
---
 fftools/ffmpeg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 01f04103cf..43bd47ded4 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2108,8 +2108,10 @@  static void check_decode_result(InputStream *ist, int *got_output, int ret)
         if (ist->decoded_frame->decode_error_flags || (ist->decoded_frame->flags & AV_FRAME_FLAG_CORRUPT)) {
             av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING,
                    "%s: corrupt decoded frame in stream %d\n", input_files[ist->file_index]->ctx->url, ist->st->index);
-            if (exit_on_error)
+            if (exit_on_error) {
+                print_final_stats(0);
                 exit_program(1);
+            }
         }
     }
 }