Skip to content

Commit

Permalink
Always use video codec specified in publish request
Browse files Browse the repository at this point in the history
Former-commit-id: a211fb4
  • Loading branch information
jbrady42 committed May 16, 2020
1 parent acc62c4 commit b8ba8c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/node/sfu/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func publish(msg map[string]interface{}) (map[string]interface{}, *nprotoo.Error
rtcOptions["bandwidth"] = options["bandwidth"]
}
}

videoCodec := strings.ToUpper(rtcOptions["codec"].(string))

pub := transport.NewWebRTCTransport(mid, rtcOptions)
if pub == nil {
return nil, util.NewNpError(415, "publish: transport.NewWebRTCTransport failed.")
Expand Down Expand Up @@ -121,7 +124,7 @@ func publish(msg map[string]interface{}) (map[string]interface{}, *nprotoo.Error
}
} else if track.GetMedia() == "video" {
codecType = strings.ToUpper(codec.GetCodec())
if codecType == webrtc.H264 || codecType == webrtc.VP8 || codecType == webrtc.VP9 {
if codecType == videoCodec {
pt = payload
break
}
Expand Down

0 comments on commit b8ba8c4

Please sign in to comment.