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
18 18
19#include "libavutil/avassert.h"19#include "libavutil/avassert.h"
20#include "libavutil/common.h"20#include "libavutil/common.h"
21#include "libavutil/error.h"
21#include "libavutil/internal.h"22#include "libavutil/internal.h"
22#include "libavutil/log.h"23#include "libavutil/log.h"
23#include "libavutil/mem.h"24#include "libavutil/mem.h"
@@ -603,7 +604,7 @@ start: · 579 unmodified lines
603 av_fifo_can_read(ctx->encode_fifo);604 av_fifo_can_read(ctx->encode_fifo);
604 err = ctx->op->issue(avctx, pic);605 err = ctx->op->issue(avctx, pic);
605 if (err < 0) {606 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));
607 return err;608 return err;
608 }609 }
609 pic->encode_issued = 1;610 pic->encode_issued = 1;
@@ -630,7 +631,7 @@ start: · 20 unmodified lines
630 631
631 err = ctx->op->issue(avctx, pic);632 err = ctx->op->issue(avctx, pic);
632 if (err < 0) {633 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));
634 return err;635 return err;
635 }636 }
636 637

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