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 {