make format.String() return MPEG4-audio in case of MPEG-4 audio (#300)

This commit is contained in:
Alessandro Ros
2023-06-01 20:24:31 +02:00
committed by GitHub
parent 80cf861ec7
commit 6a22c33fc7
4 changed files with 6 additions and 4 deletions

View File

@@ -100,7 +100,8 @@ func (f *MPEG4AudioGeneric) unmarshal(
// String implements Format.
func (f *MPEG4AudioGeneric) String() string {
return "MPEG4-audio-gen"
// currently, String() returns the codec name, hence hide the format name.
return "MPEG4-audio"
}
// ClockRate implements Format.

View File

@@ -21,7 +21,7 @@ func TestMPEG4AudioGenericAttributes(t *testing.T) {
IndexLength: 3,
IndexDeltaLength: 3,
}
require.Equal(t, "MPEG4-audio-gen", format.String())
require.Equal(t, "MPEG4-audio", format.String())
require.Equal(t, 48000, format.ClockRate())
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
}

View File

@@ -87,7 +87,8 @@ func (f *MPEG4AudioLATM) unmarshal(
// String implements Format.
func (f *MPEG4AudioLATM) String() string {
return "MPEG4-audio-latm"
// currently, String() returns the codec name, hence hide the format name.
return "MPEG4-audio"
}
// ClockRate implements Format.

View File

@@ -25,7 +25,7 @@ func TestMPEG4AudioLATMAttributes(t *testing.T) {
}},
},
}
require.Equal(t, "MPEG4-audio-latm", format.String())
require.Equal(t, "MPEG4-audio", format.String())
require.Equal(t, 44100, format.ClockRate())
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
}