From 59a506c15aa29e6193f8cde75e31590f0ab4e44e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 2 Jul 2023 23:32:04 -0500 Subject: [PATCH] Only select 10-bit format if also compatible with client --- src/RtspConnection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RtspConnection.c b/src/RtspConnection.c index df7accb..6bebe92 100644 --- a/src/RtspConnection.c +++ b/src/RtspConnection.c @@ -905,7 +905,7 @@ int performRtspHandshake(PSERVER_INFORMATION serverInfo) { } if ((StreamConfig.supportedVideoFormats & VIDEO_FORMAT_MASK_AV1) && strstr(response.payload, "AV1/90000")) { - if (StreamConfig.serverCodecModeSupport & SCM_AV1_MAIN10) { + if ((StreamConfig.serverCodecModeSupport & SCM_AV1_MAIN10) && (StreamConfig.supportedVideoFormats & VIDEO_FORMAT_AV1_MAIN10)) { NegotiatedVideoFormat = VIDEO_FORMAT_AV1_MAIN10; } else { @@ -925,7 +925,7 @@ int performRtspHandshake(PSERVER_INFORMATION serverInfo) { // server can support HEVC. For some reason, they still set the MIME type of the HEVC // format to H264, so we can't just look for the HEVC MIME type. What we'll do instead is // look for the base 64 encoded VPS NALU prefix that is unique to the HEVC bitstream. - if (StreamConfig.serverCodecModeSupport & SCM_HEVC_MAIN10) { + if ((StreamConfig.serverCodecModeSupport & SCM_HEVC_MAIN10) && (StreamConfig.supportedVideoFormats & VIDEO_FORMAT_H265_MAIN10)) { NegotiatedVideoFormat = VIDEO_FORMAT_H265_MAIN10; } else {