Skip to content

Commit 5318658

Browse files
committed
decompress/openapv: Print err string instead of code
1 parent 081bd2a commit 5318658

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/video_decompress/openapv.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "video_decompress.h"
4848
#include "from_planar.h"
4949
#include "openapv/from_openapv_conversions.h"
50+
#include "openapv/openapv_common.hpp"
5051

5152
namespace {
5253

@@ -80,7 +81,7 @@ state_video_decompress_openapv::state_video_decompress_openapv() {
8081
cdesc.threads = OAPV_CDESC_THREADS_AUTO;
8182
decoder_handle = oapvd_create(&cdesc, &ret);
8283
if (OAPV_FAILED(ret)) {
83-
throw std::runtime_error("oapvd_create failed (ret=" + std::to_string(ret) + ")");
84+
throw std::runtime_error("oapvd_create failed (" + std::string(oapv_err_str(ret)) + ")");
8485
}
8586

8687
decoded_frames.num_frms = MAX_NUM_FRMS;
@@ -159,7 +160,7 @@ bool configure_with(state_video_decompress_openapv *s, unsigned char *bitstream_
159160

160161
ret = oapvd_info(bitstream_buffer, codestream_size, &aui);
161162
if (OAPV_FAILED(ret) || aui.num_frms != 1) {
162-
log_msg(LOG_LEVEL_ERROR, MOD_NAME "Failed to get APV info (ret=%d, num_frms=%d).\n", ret, aui.num_frms);
163+
log_msg(LOG_LEVEL_ERROR, MOD_NAME "Failed to get APV info (%s, num_frms=%d).\n", oapv_err_str(ret), aui.num_frms);
163164
return false;
164165
}
165166

@@ -291,7 +292,7 @@ decompress_status openapv_decompress(void *state, unsigned char *dst, unsigned c
291292
oapvd_stat_t stat{};
292293
int ret = oapvd_decode(s->decoder_handle, &s->input_buffer, &s->decoded_frames, nullptr, &stat);
293294
if (OAPV_FAILED(ret)) {
294-
log_msg(LOG_LEVEL_WARNING, MOD_NAME "oapvd_decode failed ret=%d src_len=%u.\n", ret, src_len);
295+
log_msg(LOG_LEVEL_WARNING, MOD_NAME "oapvd_decode failed (%s) src_len=%u.\n", oapv_err_str(ret), src_len);
295296
return DECODER_NO_FRAME;
296297
}
297298

0 commit comments

Comments
 (0)