media: remove pointer from Medias.FindFormat()

This commit is contained in:
aler9
2022-12-12 01:00:25 +01:00
parent d74b7429ca
commit 442cfcf2df

View File

@@ -91,8 +91,8 @@ func (ms Medias) SetControls() {
// FindFormat finds a certain format among all the formats in all the medias. // FindFormat finds a certain format among all the formats in all the medias.
// If the format is found, it is inserted into trak, and format media is returned. // If the format is found, it is inserted into trak, and format media is returned.
func (ms *Medias) FindFormat(trak interface{}) *Media { func (ms Medias) FindFormat(trak interface{}) *Media {
for _, media := range *ms { for _, media := range ms {
for _, trakk := range media.Formats { for _, trakk := range media.Formats {
if reflect.TypeOf(trakk) == reflect.TypeOf(trak).Elem() { if reflect.TypeOf(trakk) == reflect.TypeOf(trak).Elem() {
reflect.ValueOf(trak).Elem().Set(reflect.ValueOf(trakk)) reflect.ValueOf(trak).Elem().Set(reflect.ValueOf(trakk))