Fix default sample rate for MP3 codec

This commit is contained in:
Alexey Khit
2023-04-22 18:15:20 +03:00
parent dd98edc48e
commit 5926c1deb9
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ func UnmarshalCodec(md *sdp.MediaDescription, payloadType string) *Codec {
c.ClockRate = 44100
case "14":
c.Name = CodecMP3
c.ClockRate = 44100
c.ClockRate = 90000 // it's not real sample rate
case "26":
c.Name = CodecJPEG
c.ClockRate = 90000
+2
View File
@@ -118,6 +118,7 @@ func (m *Movie) WriteEsdsAAC(conf []byte) {
m.Skip(2) // es id
m.Skip(1) // es flags
// https://learn.microsoft.com/en-us/windows/win32/medfound/mpeg-4-file-sink#aac-audio
m.WriteBytes(4, 0x80, 0x80, 0x80, size4+header+size5)
m.WriteBytes(0x40) // object id
m.WriteBytes(0x15) // stream type
@@ -151,6 +152,7 @@ func (m *Movie) WriteEsdsMP3() {
m.Skip(2) // es id
m.Skip(1) // es flags
// https://learn.microsoft.com/en-us/windows/win32/medfound/mpeg-4-file-sink#mp3-audio
m.WriteBytes(4, 0x80, 0x80, 0x80, size4)
m.WriteBytes(0x6B) // object id
m.WriteBytes(0x15) // stream type