Skip to content

Commit 0ae5b1b

Browse files
committed
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 <[email protected]>
1 parent 3fca587 commit 0ae5b1b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libavcodec/hw_base_encode.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
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 @@ int ff_hw_base_encode_receive_packet(FFHWBaseEncodeContext *ctx,
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 @@ int ff_hw_base_encode_receive_packet(FFHWBaseEncodeContext *ctx,
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

0 commit comments

Comments
 (0)