History

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.

Marth64 committed 1 year ago

Commit 0ae5b1b1 parent 3fca5871 file · +3 −2Browse files

Unified · Split

libavcodec/hw_base_encode.c+3−2
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 #include "libavutil/avassert.h"
2020 #include "libavutil/common.h"
21+#include "libavutil/error.h"
2122 #include "libavutil/internal.h"
2223 #include "libavutil/log.h"
2324 #include "libavutil/mem.h"
@@ -603,7 +604,7 @@ start: · 579 unmodified lines
603604 av_fifo_can_read(ctx->encode_fifo);
604605 err = ctx->op->issue(avctx, pic);
605606 if (err < 0) {
606− av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err);
607+ av_log(avctx, AV_LOG_ERROR, "Encode failed: %s.\n", av_err2str(err));
607608 return err;
608609 }
609610 pic->encode_issued = 1;
@@ -630,7 +631,7 @@ start: · 20 unmodified lines
630631
631632 err = ctx->op->issue(avctx, pic);
632633 if (err < 0) {
633− av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err);
634+ av_log(avctx, AV_LOG_ERROR, "Encode failed: %s.\n", av_err2str(err));
634635 return err;
635636 }
636637

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t