mirror of https://bitbucket.org/ausocean/av.git
adpcm and mts: comments and pid change
This commit is contained in:
parent
fa2ae7b9c7
commit
96035f6d8b
|
@ -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).
|
// 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 {
|
func EncBytes(n int) int {
|
||||||
// For 'n' pcm bytes, 1 sample is left uncompressed, the rest is compressed by a factor of 4
|
// 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.
|
// 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 {
|
if n%bytesPerEnc == 0 {
|
||||||
return (n-byteDepth)/compFact + headSize + 1
|
return (n-byteDepth)/compFact + headSize + 1
|
||||||
|
|
|
@ -44,7 +44,7 @@ import (
|
||||||
const (
|
const (
|
||||||
H264ID = 27
|
H264ID = 27
|
||||||
H265ID = 36
|
H265ID = 36
|
||||||
audioStreamID = 0xc0 // First audio stream ID.
|
audioStreamID = 0xc0 // ADPCM audio stream ID.
|
||||||
)
|
)
|
||||||
|
|
||||||
// Constants used to communicate which media codec will be packetized.
|
// 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,
|
Pil: 0,
|
||||||
Essd: &psi.ESSD{
|
Essd: &psi.ESSD{
|
||||||
St: byte(sid),
|
St: byte(sid),
|
||||||
Epid: 0x0100,
|
Epid: byte(mPid),
|
||||||
Esil: 0x00,
|
Esil: 0x00,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue