mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
cellAtracXdec: review fixes
This commit is contained in:
parent
965dbf2c12
commit
e678931cee
1 changed files with 12 additions and 2 deletions
|
@ -111,6 +111,8 @@ void AtracXdecDecoder::alloc_avcodec()
|
||||||
fmt::throw_exception("avcodec_find_decoder() failed");
|
fmt::throw_exception("avcodec_find_decoder() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensure(!(codec->capabilities & AV_CODEC_CAP_SUBFRAMES));
|
||||||
|
|
||||||
ctx = avcodec_alloc_context3(codec);
|
ctx = avcodec_alloc_context3(codec);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
{
|
{
|
||||||
|
@ -411,11 +413,19 @@ void AtracXdecContext::exec(ppu_thread& ppu)
|
||||||
|
|
||||||
if (int err = avcodec_send_packet(decoder.ctx, decoder.packet); err)
|
if (int err = avcodec_send_packet(decoder.ctx, decoder.packet); err)
|
||||||
{
|
{
|
||||||
cellAtracXdec.error("avcodec_send_packet() failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
// These errors should never occur
|
||||||
error = CELL_ADEC_ERROR_ATX_NON_FATAL; // Not accurate, FFmpeg doesn't provide detailed errors like LLE
|
if (err == AVERROR(EAGAIN) || err == AVERROR_EOF || err == AVERROR(EINVAL) || err == AVERROR(ENOMEM))
|
||||||
|
{
|
||||||
|
fmt::throw_exception("avcodec_send_packet() failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (int err = avcodec_receive_frame(decoder.ctx, decoder.frame); err != 0 && err != AVERROR(EAGAIN))
|
// Game sent invalid data
|
||||||
|
cellAtracXdec.error("avcodec_send_packet() failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
||||||
|
error = CELL_ADEC_ERROR_ATX_NON_FATAL; // Not accurate, FFmpeg doesn't provide detailed errors like LLE
|
||||||
|
|
||||||
|
av_frame_unref(decoder.frame);
|
||||||
|
}
|
||||||
|
else if (err = avcodec_receive_frame(decoder.ctx, decoder.frame))
|
||||||
{
|
{
|
||||||
fmt::throw_exception("avcodec_receive_frame() failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
fmt::throw_exception("avcodec_receive_frame() failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue