Use requested color range as a fallback in isFrameFullRange()

This commit is contained in:
Cameron Gutman
2026-08-05 23:54:19 -05:00
parent 3f26217df7
commit b2f0828df8
@@ -247,10 +247,16 @@ public:
} }
virtual bool isFrameFullRange(const AVFrame* frame) { virtual bool isFrameFullRange(const AVFrame* frame) {
// This handles the case where the color range is unknown, switch (frame->color_range) {
// so that we use Limited color range which is the default case AVCOL_RANGE_JPEG:
// behavior for Moonlight. return true;
return frame->color_range == AVCOL_RANGE_JPEG; case AVCOL_RANGE_MPEG:
return false;
default:
// If the color range is not populated, assume the encoder
// is sending the color range that we requested.
return getDecoderColorRange() == COLOR_RANGE_FULL;
}
} }
virtual bool isRenderThreadSupported() { virtual bool isRenderThreadSupported() {