mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
support generic tracks with multiple formats (https://github.com/aler9/rtsp-simple-server/issues/1103)
This commit is contained in:
@@ -14,11 +14,11 @@ type TrackPCMU struct {
|
||||
|
||||
func newTrackPCMUFromMediaDescription(
|
||||
control string,
|
||||
rtpmapPart1 string) (*TrackPCMU, error,
|
||||
clock string) (*TrackPCMU, error,
|
||||
) {
|
||||
tmp := strings.Split(rtpmapPart1, "/")
|
||||
if len(tmp) >= 3 && tmp[2] != "1" {
|
||||
return nil, fmt.Errorf("PCMU tracks must have only one channel")
|
||||
tmp := strings.SplitN(clock, "/", 2)
|
||||
if len(tmp) == 2 && tmp[1] != "1" {
|
||||
return nil, fmt.Errorf("PCMU tracks can have only one channel")
|
||||
}
|
||||
|
||||
return &TrackPCMU{
|
||||
|
Reference in New Issue
Block a user