mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-10 08:59:57 +00:00
use Track.String() instead of reflect for getting track names
This commit is contained in:
parent
e605727c78
commit
7ed0a873f5
@ -231,7 +231,7 @@ func TestAPIPathsList(t *testing.T) {
|
||||
Type: "rtspSession",
|
||||
},
|
||||
SourceReady: true,
|
||||
Tracks: []string{"H264", "MPEG4Audio"},
|
||||
Tracks: []string{"H264", "MPEG4-audio"},
|
||||
BytesReceived: 16,
|
||||
},
|
||||
},
|
||||
@ -291,7 +291,7 @@ func TestAPIPathsList(t *testing.T) {
|
||||
Type: "rtspsSession",
|
||||
},
|
||||
SourceReady: true,
|
||||
Tracks: []string{"H264", "MPEG4Audio"},
|
||||
Tracks: []string{"H264", "MPEG4-audio"},
|
||||
},
|
||||
},
|
||||
}, out)
|
||||
|
@ -2,7 +2,6 @@ package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/aler9/gortsplib"
|
||||
@ -20,9 +19,7 @@ type source interface {
|
||||
func sourceTrackNames(tracks gortsplib.Tracks) []string {
|
||||
ret := make([]string, len(tracks))
|
||||
for i, t := range tracks {
|
||||
n := reflect.TypeOf(t).Elem().Name()
|
||||
n = n[len("Track"):]
|
||||
ret[i] = n
|
||||
ret[i] = t.String()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user