Skip to content

Commit

Permalink
Update payloaderForCodec to be case insensitive
Browse files Browse the repository at this point in the history
Remove sharp edge when creating sample track
  • Loading branch information
pascal-pro authored and Sean-Der committed Dec 14, 2020
1 parent f5875d9 commit 85ced4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
* [Bo Shi](https://github.com/bshimc)
* [Suzuki Takeo](https://github.com/BambooTuna)
* [baiyufei](https://github.com/baiyufei)
* [pascal-ace](https://github.com/pascal-ace)

### License
MIT License - see [LICENSE](LICENSE) for full text
12 changes: 6 additions & 6 deletions mediaengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,17 +494,17 @@ func (m *MediaEngine) getRTPParametersByPayloadType(payloadType PayloadType) (RT

func payloaderForCodec(codec RTPCodecCapability) (rtp.Payloader, error) {
switch strings.ToLower(codec.MimeType) {
case MimeTypeH264:
case strings.ToLower(MimeTypeH264):
return &codecs.H264Payloader{}, nil
case MimeTypeOpus:
case strings.ToLower(MimeTypeOpus):
return &codecs.OpusPayloader{}, nil
case MimeTypeVP8:
case strings.ToLower(MimeTypeVP8):
return &codecs.VP8Payloader{}, nil
case MimeTypeVP9:
case strings.ToLower(MimeTypeVP9):
return &codecs.VP9Payloader{}, nil
case MimeTypeG722:
case strings.ToLower(MimeTypeG722):
return &codecs.G722Payloader{}, nil
case MimeTypePCMU, MimeTypePCMA:
case strings.ToLower(MimeTypePCMU), strings.ToLower(MimeTypePCMA):
return &codecs.G711Payloader{}, nil
default:
return nil, ErrNoPayloaderForCodec
Expand Down

0 comments on commit 85ced4a

Please sign in to comment.