Hi!

Attached patch implements more verbose warnings as suggested by Nicolas.

Please comment, Carl Eugen
From 5ec3b8bdb776d9c14127017cd9e3077503be2bea Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Thu, 23 Nov 2017 12:05:51 +0100
Subject: [PATCH] ffmpeg: Improve warnings if av_buffersrc_add_frame*() fail.

Suggested-by: Nicolas
---
 fftools/ffmpeg.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 0c16e75..3ce8833 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -229,7 +229,8 @@ static void sub2video_push_ref(InputStream *ist, int64_t pts)
                                            AV_BUFFERSRC_FLAG_KEEP_REF |
                                            AV_BUFFERSRC_FLAG_PUSH);
         if (ret != AVERROR_EOF && ret < 0)
-            av_log(NULL, AV_LOG_WARNING, "Error while add the frame to buffer source(%s).\n",
+            av_log(ist->filters[i]->filter, AV_LOG_WARNING,
+                   "Failed to add a subtitle video frame to the buffer source: %s\n",
                    av_err2str(ret));
     }
 }
@@ -307,7 +308,9 @@ static void sub2video_flush(InputStream *ist)
     for (i = 0; i < ist->nb_filters; i++) {
         ret = av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
         if (ret != AVERROR_EOF && ret < 0)
-            av_log(NULL, AV_LOG_WARNING, "Flush the frame error.\n");
+            av_log(ist->filters[i]->filter, AV_LOG_WARNING,
+                   "Failed to add a subtitle video frame to the buffer source: %s\n",
+                   av_err2str(ret));
     }
 }
 
-- 
1.7.10.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to