fix: skip RTX/FEC when picking a fallback video codec (#4930)
selectAlternativeVideoCodec walked the enabled codecs and returned the first one with a video/ prefix. video/rtx and video/flexfec-03 both have that prefix, so when the requested codec was not enabled the track could fall back to RTX. RTX is a retransmission stream, not a real codec, so the track got registered as video/rtx and subscribers saw a blank tile. Skip RTX and FEC entries so the fallback is always a valid video codec. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
edb19c9e8f
commit
c2339b2b85
@@ -162,6 +162,10 @@ func isCodecEnabledWithFmtp(codecs []*livekit.Codec, cap webrtc.RTPCodecCapabili
|
||||
|
||||
func selectAlternativeVideoCodec(enabledCodecs []*livekit.Codec) string {
|
||||
for _, c := range enabledCodecs {
|
||||
// RTX and FEC are not real codecs, skip them
|
||||
if mime.IsMimeTypeStringRTX(c.Mime) || mime.IsMimeTypeStringFlexFEC03(c.Mime) {
|
||||
continue
|
||||
}
|
||||
if mime.IsMimeTypeStringVideo(c.Mime) {
|
||||
return c.Mime
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user