adpcm and mts: comments and pid change

This commit is contained in:
Trek H 2019-09-12 19:16:11 +09:30
parent fa2ae7b9c7
commit 96035f6d8b
2 changed files with 3 additions and 3 deletions

View File

@ -369,7 +369,7 @@ func capAdd16(a, b int16) int16 {
// EncBytes will return the number of adpcm bytes that will be generated when encoding the given amount of pcm bytes (n).
func EncBytes(n int) int {
// For 'n' pcm bytes, 1 sample is left uncompressed, the rest is compressed by a factor of 4
// and a start index and padding-flag byte are added.
// and a chunk length (4B), start index (1B) and padding-flag (1B) are added.
// Also if there are an even number of samples, there will be half a byte of padding added to the last byte.
if n%bytesPerEnc == 0 {
return (n-byteDepth)/compFact + headSize + 1

View File

@ -44,7 +44,7 @@ import (
const (
H264ID = 27
H265ID = 36
audioStreamID = 0xc0 // First audio stream ID.
audioStreamID = 0xc0 // ADPCM audio stream ID.
)
// Constants used to communicate which media codec will be packetized.
@ -168,7 +168,7 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder {
Pil: 0,
Essd: &psi.ESSD{
St: byte(sid),
Epid: 0x0100,
Epid: byte(mPid),
Esil: 0x00,
},
}