1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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@proxyid.net>
This commit is contained in:
Marth64
2025-02-03 15:10:02 -06:00
parent 3fca5877d0
commit 0ae5b1bfcc

View File

@ -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;
}