[FFmpeg-cvslog] avcodec/hw_base_encode: log the readable error message on failure

Marth64 git at videolan.org
Mon Feb 10 04:29:37 EET 2025


ffmpeg | branch: master | Marth64 <marth64 at proxyid.net> | Mon Feb  3 15:10:02 2025 -0600| [0ae5b1bfcca7fbf179e6bebdc020f8372fcbc8c1] | committer: Marth64

avcodec/hw_base_encode: log the readable error message on failure

Currently, if there is a hardware encode failure, the numeric
error code will be printed making it somewhat hard to get to
the root cause of the issue. Print the readable message generated
by av_err2str() instead.

Signed-off-by: Marth64 <marth64 at proxyid.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ae5b1bfcca7fbf179e6bebdc020f8372fcbc8c1
---

 libavcodec/hw_base_encode.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hw_base_encode.c b/libavcodec/hw_base_encode.c
index b790091d7d..33a30c8d10 100644
--- a/libavcodec/hw_base_encode.c
+++ b/libavcodec/hw_base_encode.c
@@ -18,6 +18,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/common.h"
+#include "libavutil/error.h"
 #include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
@@ -603,7 +604,7 @@ start:
                     av_fifo_can_read(ctx->encode_fifo);
                 err = ctx->op->issue(avctx, pic);
                 if (err < 0) {
-                    av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err);
+                    av_log(avctx, AV_LOG_ERROR, "Encode failed: %s.\n", av_err2str(err));
                     return err;
                 }
                 pic->encode_issued = 1;
@@ -630,7 +631,7 @@ start:
 
         err = ctx->op->issue(avctx, pic);
         if (err < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err);
+            av_log(avctx, AV_LOG_ERROR, "Encode failed: %s.\n", av_err2str(err));
             return err;
         }
 



More information about the ffmpeg-cvslog mailing list