1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

cellVdec: use av_error_to_string

This commit is contained in:
Megamouse 2022-04-21 09:32:28 +02:00
parent 7c65c1e3aa
commit f42e647430
2 changed files with 4 additions and 10 deletions

View File

@ -390,9 +390,7 @@ struct vdec_context final
if (int ret = avcodec_send_packet(ctx, &packet); ret < 0)
{
char av_error[AV_ERROR_MAX_STRING_SIZE]{};
av_make_error_string(av_error, AV_ERROR_MAX_STRING_SIZE, ret);
fmt::throw_exception("AU queuing error(0x%x): %s", ret, av_error);
fmt::throw_exception("AU queuing error(0x%x): %s", ret, utils::av_error_to_string(ret));
}
else
{
@ -414,9 +412,7 @@ struct vdec_context final
break;
}
char av_error[AV_ERROR_MAX_STRING_SIZE]{};
av_make_error_string(av_error, AV_ERROR_MAX_STRING_SIZE, ret);
fmt::throw_exception("AU decoding error(0x%x): %s", ret, av_error);
fmt::throw_exception("AU decoding error(0x%x): %s", ret, utils::av_error_to_string(ret));
}
if (frame->interlaced_frame)
@ -1209,9 +1205,7 @@ error_code cellVdecGetPictureExt(u32 handle, vm::cptr<CellVdecPicFormat2> format
if (const int ret = av_image_fill_linesizes(out_line, out_f, w); ret < 0)
{
char av_error[AV_ERROR_MAX_STRING_SIZE]{};
av_make_error_string(av_error, AV_ERROR_MAX_STRING_SIZE, ret);
fmt::throw_exception("cellVdecGetPicture: av_image_fill_linesizes failed (ret=0x%x): %s", ret, av_error);
fmt::throw_exception("cellVdecGetPicture: av_image_fill_linesizes failed (ret=0x%x): %s", ret, utils::av_error_to_string(ret));
}
}

View File

@ -57,7 +57,7 @@ namespace utils
std::string av_error_to_string(int error)
{
char av_error[AV_ERROR_MAX_STRING_SIZE];
char av_error[AV_ERROR_MAX_STRING_SIZE]{};
av_make_error_string(av_error, AV_ERROR_MAX_STRING_SIZE, error);
return av_error;
}