This commit is contained in:
Nekotekina 2015-02-11 14:39:51 +03:00
parent 2032b15acf
commit fdc5fa34be
7 changed files with 36 additions and 25 deletions

View file

@ -679,7 +679,11 @@ int cellAdecGetPcm(u32 handle, vm::ptr<float> outBuffer)
return CELL_ADEC_ERROR_EMPTY;
}
AVFrame* frame = af.data;
std::unique_ptr<AVFrame, void(*)(AVFrame*)> frame(af.data, [](AVFrame* frame)
{
av_frame_unref(frame);
av_frame_free(&frame);
});
if (outBuffer)
{
@ -766,13 +770,10 @@ int cellAdecGetPcm(u32 handle, vm::ptr<float> outBuffer)
}
else
{
cellAdec->Error("cellAdecGetPcm(): unsupported frame format (channels=%d, format=%d)", frame->channels, frame->format);
Emu.Pause();
cellAdec->Fatal("cellAdecGetPcm(): unsupported frame format (channels=%d, format=%d)", frame->channels, frame->format);
}
}
av_frame_unref(af.data);
av_frame_free(&af.data);
return CELL_OK;
}