mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 19:15:46 +00:00
[host1x] Fix FFmpeg crash on Linux (#37)
This fixes the FFmpeg crash on Linux / Steam Deck. Credit to Maufeat for AVERROR_EOF check. Co-authored-by: MaranBr <maranbr@outlook.com> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/37 Co-authored-by: MaranBr <maranbr@eden-emu.dev> Co-committed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
a8564a09b7
commit
e9ca3f4c06
3 changed files with 16 additions and 9 deletions
|
@ -216,18 +216,16 @@ bool DecoderContext::OpenContext(const Decoder& decoder) {
|
|||
|
||||
bool DecoderContext::SendPacket(const Packet& packet) {
|
||||
m_temp_frame = std::make_shared<Frame>();
|
||||
|
||||
if (const int ret = avcodec_send_packet(m_codec_context, packet.GetPacket()); ret < 0) {
|
||||
if (const int ret = avcodec_send_packet(m_codec_context, packet.GetPacket()); ret < 0 && ret != AVERROR_EOF) {
|
||||
LOG_ERROR(HW_GPU, "avcodec_send_packet error: {}", AVError(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<Frame> DecoderContext::ReceiveFrame() {
|
||||
auto ReceiveImpl = [&](AVFrame* frame) -> bool {
|
||||
if (const int ret = avcodec_receive_frame(m_codec_context, frame); ret < 0) {
|
||||
if (const int ret = avcodec_receive_frame(m_codec_context, frame); ret < 0 && ret != AVERROR_EOF) {
|
||||
LOG_ERROR(HW_GPU, "avcodec_receive_frame error: {}", AVError(ret));
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue