From e285a2318f689eaafdc872bcd8fc5c8eea1db941 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 4 Jun 2019 15:00:08 +0200 Subject: [PATCH] Lavd: print text representation of error --- src/libavcodec_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libavcodec_common.h b/src/libavcodec_common.h index 80432982f..5b5579e77 100644 --- a/src/libavcodec_common.h +++ b/src/libavcodec_common.h @@ -168,6 +168,7 @@ static const std::unordered_map> ug_ #endif // __cplusplus static void print_decoder_error(const char *mod_name, int rc) { + char buf[1024]; switch (rc) { case 0: break; @@ -178,7 +179,8 @@ static void print_decoder_error(const char *mod_name, int rc) { log_msg(LOG_LEVEL_ERROR, "%s Decoder in invalid state!\n", mod_name); break; default: - log_msg(LOG_LEVEL_WARNING, "%s Error while decoding frame (rc == %d).\n", mod_name, rc); + av_strerror(rc, buf, 1024); + log_msg(LOG_LEVEL_WARNING, "%s Error while decoding frame (rc == %d): %s.\n", mod_name, rc, buf); break; } }