List audio codecs after video codecs. (#3589)

This commit is contained in:
Raja Subramanian
2025-04-07 21:38:56 +05:30
committed by GitHub
parent 05a891ffdb
commit 68357ba60a
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ var StaticConfigurations = []ConfigurationItem{
Merge: false,
},
{
Match: &ScriptMatch{Expr: `c.sdk == "flutter" && c.version == "2.4.2" && c.os == "android"`},
Match: &ScriptMatch{Expr: `c.sdk == "flutter" && c.version == "2.4.2"`},
Configuration: &livekit.ClientConfiguration{
DisabledCodecs: &livekit.DisabledCodecs{
Publish: []*livekit.Codec{
+10 -3
View File
@@ -3114,7 +3114,8 @@ func (p *ParticipantImpl) setupEnabledCodecs(publishEnabledCodecs []*livekit.Cod
return false
}
publishCodecs := make([]*livekit.Codec, 0, len(publishEnabledCodecs))
publishCodecsAudio := make([]*livekit.Codec, 0, len(publishEnabledCodecs))
publishCodecsVideo := make([]*livekit.Codec, 0, len(publishEnabledCodecs))
for _, c := range publishEnabledCodecs {
if shouldDisable(c, disabledCodecs.GetCodecs()) || shouldDisable(c, disabledCodecs.GetPublish()) {
continue
@@ -3130,10 +3131,16 @@ func (p *ParticipantImpl) setupEnabledCodecs(publishEnabledCodecs []*livekit.Cod
} else if mime.IsMimeTypeStringH264(c.Mime) {
p.enabledPublishCodecs = append(p.enabledPublishCodecs, c)
} else {
publishCodecs = append(publishCodecs, c)
if mime.IsMimeTypeStringAudio(c.Mime) {
publishCodecsAudio = append(publishCodecsAudio, c)
} else {
publishCodecsVideo = append(publishCodecsVideo, c)
}
}
}
p.enabledPublishCodecs = append(p.enabledPublishCodecs, publishCodecs...)
// list all video first and then audio to work around a client side issue with Flutter SDK 2.4.2
p.enabledPublishCodecs = append(p.enabledPublishCodecs, publishCodecsVideo...)
p.enabledPublishCodecs = append(p.enabledPublishCodecs, publishCodecsAudio...)
subscribeCodecs := make([]*livekit.Codec, 0, len(subscribeEnabledCodecs))
for _, c := range subscribeEnabledCodecs {