mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-10 17:09:56 +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",
|
Type: "rtspSession",
|
||||||
},
|
},
|
||||||
SourceReady: true,
|
SourceReady: true,
|
||||||
Tracks: []string{"H264", "MPEG4Audio"},
|
Tracks: []string{"H264", "MPEG4-audio"},
|
||||||
BytesReceived: 16,
|
BytesReceived: 16,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -291,7 +291,7 @@ func TestAPIPathsList(t *testing.T) {
|
|||||||
Type: "rtspsSession",
|
Type: "rtspsSession",
|
||||||
},
|
},
|
||||||
SourceReady: true,
|
SourceReady: true,
|
||||||
Tracks: []string{"H264", "MPEG4Audio"},
|
Tracks: []string{"H264", "MPEG4-audio"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, out)
|
}, out)
|
||||||
|
@ -2,7 +2,6 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/aler9/gortsplib"
|
"github.com/aler9/gortsplib"
|
||||||
@ -20,9 +19,7 @@ type source interface {
|
|||||||
func sourceTrackNames(tracks gortsplib.Tracks) []string {
|
func sourceTrackNames(tracks gortsplib.Tracks) []string {
|
||||||
ret := make([]string, len(tracks))
|
ret := make([]string, len(tracks))
|
||||||
for i, t := range tracks {
|
for i, t := range tracks {
|
||||||
n := reflect.TypeOf(t).Elem().Name()
|
ret[i] = t.String()
|
||||||
n = n[len("Track"):]
|
|
||||||
ret[i] = n
|
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user