mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-22 16:08:45 +00:00
Don't attempt to use mismatched 8-bit formats with 10-bit codecs
In addition to silently truncating the samples, this also tickles some nasty bugs in the VF2's out-of-tree OMX decoder.
This commit is contained in:
@@ -80,20 +80,25 @@ bool SdlRenderer::isRenderThreadSupported()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SdlRenderer::isPixelFormatSupported(int, AVPixelFormat pixelFormat)
|
||||
bool SdlRenderer::isPixelFormatSupported(int videoFormat, AVPixelFormat pixelFormat)
|
||||
{
|
||||
// Remember to keep this in sync with SdlRenderer::renderFrame()!
|
||||
switch (pixelFormat)
|
||||
{
|
||||
case AV_PIX_FMT_YUV420P:
|
||||
case AV_PIX_FMT_YUVJ420P:
|
||||
case AV_PIX_FMT_NV12:
|
||||
case AV_PIX_FMT_NV21:
|
||||
return true;
|
||||
|
||||
default:
|
||||
if (videoFormat & VIDEO_FORMAT_MASK_10BIT) {
|
||||
// SDL2 doesn't support 10-bit pixel formats
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// Remember to keep this in sync with SdlRenderer::renderFrame()!
|
||||
switch (pixelFormat) {
|
||||
case AV_PIX_FMT_YUV420P:
|
||||
case AV_PIX_FMT_YUVJ420P:
|
||||
case AV_PIX_FMT_NV12:
|
||||
case AV_PIX_FMT_NV21:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SdlRenderer::initialize(PDECODER_PARAMETERS params)
|
||||
|
||||
Reference in New Issue
Block a user