mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Add fallback logic when the host doesn't send valid colorspace data
This commit is contained in:
parent
fabebc05d2
commit
81cfacaa3d
@ -720,8 +720,22 @@ void D3D11VARenderer::bindColorConversion(AVFrame* frame)
|
|||||||
rawCscMatrix = fullRange ? k_CscMatrix_Bt2020Full : k_CscMatrix_Bt2020Lim;
|
rawCscMatrix = fullRange ? k_CscMatrix_Bt2020Full : k_CscMatrix_Bt2020Lim;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SDL_assert(false);
|
// Sunshine doesn't always populate this data correctly,
|
||||||
return;
|
// so fallback to assuming they're sending what we asked for.
|
||||||
|
switch (getDecoderColorspace()) {
|
||||||
|
case COLORSPACE_REC_601:
|
||||||
|
rawCscMatrix = fullRange ? k_CscMatrix_Bt601Full : k_CscMatrix_Bt601Lim;
|
||||||
|
break;
|
||||||
|
case COLORSPACE_REC_709:
|
||||||
|
rawCscMatrix = fullRange ? k_CscMatrix_Bt709Full : k_CscMatrix_Bt709Lim;
|
||||||
|
break;
|
||||||
|
case COLORSPACE_REC_2020:
|
||||||
|
rawCscMatrix = fullRange ? k_CscMatrix_Bt2020Full : k_CscMatrix_Bt2020Lim;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SDL_assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to adjust our raw CSC matrix to be column-major and with float3 vectors
|
// We need to adjust our raw CSC matrix to be column-major and with float3 vectors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user