Fix default sample rate for MP3 codec
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user