Try to fix Steam Deck's Game Mode
All checks were successful
eden-license / license-header (pull_request) Successful in 15s
All checks were successful
eden-license / license-header (pull_request) Successful in 15s
This commit is contained in:
parent
7805df9d6c
commit
d060132523
1 changed files with 7 additions and 5 deletions
|
@ -233,20 +233,22 @@ std::shared_ptr<Frame> DecoderContext::ReceiveFrame() {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<Frame> intermediate_frame = std::make_shared<Frame>();
|
Frame intermediate_frame;
|
||||||
if (!ReceiveImpl(intermediate_frame->GetFrame())) {
|
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…
Add table
Add a link
Reference in a new issue