mirror of
https://github.com/livekit/livekit.git
synced 2026-05-14 22:45:20 +00:00
add missing strings.EqualFold for some mimeType comparisons (#2701)
This commit is contained in:
@@ -469,7 +469,7 @@ func (t *MediaTrackReceiver) AddSubscriber(sub types.LocalParticipant) (types.Su
|
||||
codec := receiver.Codec()
|
||||
var found bool
|
||||
for _, pc := range potentialCodecs {
|
||||
if codec.MimeType == pc.MimeType {
|
||||
if strings.EqualFold(codec.MimeType, pc.MimeType) {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package rtc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/pion/rtcp"
|
||||
@@ -258,7 +259,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
|
||||
Stereo: info.Stereo,
|
||||
Red: !info.DisableRed,
|
||||
}
|
||||
if addTrackParams.Red && (len(codecs) == 1 && codecs[0].MimeType == webrtc.MimeTypeOpus) {
|
||||
if addTrackParams.Red && (len(codecs) == 1 && strings.EqualFold(codecs[0].MimeType, webrtc.MimeTypeOpus)) {
|
||||
addTrackParams.Red = false
|
||||
}
|
||||
|
||||
@@ -354,7 +355,7 @@ func (t *MediaTrackSubscriptions) GetAllSubscribersForMime(mime string) []liveki
|
||||
|
||||
subs := make([]livekit.ParticipantID, 0, len(t.subscribedTracks))
|
||||
for id, subTrack := range t.subscribedTracks {
|
||||
if subTrack.DownTrack().Codec().MimeType != mime {
|
||||
if !strings.EqualFold(subTrack.DownTrack().Codec().MimeType, mime) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ func (r *WrappedReceiver) StreamID() string {
|
||||
func (r *WrappedReceiver) DetermineReceiver(codec webrtc.RTPCodecCapability) {
|
||||
r.determinedCodec = codec
|
||||
for _, receiver := range r.receivers {
|
||||
if c := receiver.Codec(); c.MimeType == codec.MimeType {
|
||||
if c := receiver.Codec(); strings.EqualFold(c.MimeType, codec.MimeType) {
|
||||
r.TrackReceiver = receiver
|
||||
break
|
||||
} else if strings.EqualFold(c.MimeType, sfu.MimeTypeAudioRed) && strings.EqualFold(codec.MimeType, webrtc.MimeTypeOpus) {
|
||||
|
||||
Reference in New Issue
Block a user