Browse Source

Try to fix Steam Deck's Game Mode

pull/37/head
MaranBr 8 months ago
committed by crueter
parent
commit
d060132523
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 12
      src/video_core/host1x/ffmpeg/ffmpeg.cpp

12
src/video_core/host1x/ffmpeg/ffmpeg.cpp

@ -233,20 +233,22 @@ std::shared_ptr<Frame> DecoderContext::ReceiveFrame() {
return true; return true;
}; };
std::shared_ptr<Frame> intermediate_frame = std::make_shared<Frame>();
if (!ReceiveImpl(intermediate_frame->GetFrame())) {
Frame intermediate_frame;
if (!ReceiveImpl(intermediate_frame.GetFrame())) {
return {}; return {};
} }
const auto desc = av_pix_fmt_desc_get(intermediate_frame->GetPixelFormat());
const auto desc = av_pix_fmt_desc_get(intermediate_frame.GetPixelFormat());
if (m_codec_context->hw_device_ctx && (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) { if (m_codec_context->hw_device_ctx && (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
m_temp_frame->SetFormat(PreferredGpuFormat); m_temp_frame->SetFormat(PreferredGpuFormat);
if (int ret = av_hwframe_transfer_data(m_temp_frame->GetFrame(), intermediate_frame->GetFrame(), 0); ret < 0) {
if (int ret = av_hwframe_transfer_data(m_temp_frame->GetFrame(), intermediate_frame.GetFrame(), 0); ret < 0) {
LOG_ERROR(HW_GPU, "av_hwframe_transfer_data error: {}", AVError(ret)); LOG_ERROR(HW_GPU, "av_hwframe_transfer_data error: {}", AVError(ret));
return {}; return {};
} }
} else { } else {
m_temp_frame = std::move(intermediate_frame);
if(!ReceiveImpl(m_temp_frame->GetFrame())) {
return {};
}
} }
return std::move(m_temp_frame); return std::move(m_temp_frame);

Loading…
Cancel
Save