From e9ca3f4c069b4ed4386d7086bc676c83e4334adc Mon Sep 17 00:00:00 2001 From: MaranBr Date: Mon, 14 Jul 2025 22:30:54 +0200 Subject: [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 Co-authored-by: crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/37 Co-authored-by: MaranBr Co-committed-by: MaranBr --- src/video_core/host1x/ffmpeg/ffmpeg.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/video_core/host1x/ffmpeg/ffmpeg.cpp') diff --git a/src/video_core/host1x/ffmpeg/ffmpeg.cpp b/src/video_core/host1x/ffmpeg/ffmpeg.cpp index 5321c8c98c..d6eff2bdd7 100644 --- a/src/video_core/host1x/ffmpeg/ffmpeg.cpp +++ b/src/video_core/host1x/ffmpeg/ffmpeg.cpp @@ -216,18 +216,16 @@ bool DecoderContext::OpenContext(const Decoder& decoder) { bool DecoderContext::SendPacket(const Packet& packet) { m_temp_frame = std::make_shared(); - - 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 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; } -- cgit v1.2.3