mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
rtpaac, rtph264: replace relativeType with payloadType
This commit is contained in:
@@ -27,14 +27,14 @@ type Encoder struct {
|
||||
}
|
||||
|
||||
// NewEncoder allocates an Encoder.
|
||||
func NewEncoder(relativeType uint8, config []byte) (*Encoder, error) {
|
||||
func NewEncoder(payloadType uint8, config []byte) (*Encoder, error) {
|
||||
codec, err := aac.FromMPEG4AudioConfigBytes(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Encoder{
|
||||
payloadType: 96 + relativeType,
|
||||
payloadType: payloadType,
|
||||
sampleRate: float64(codec.Config.SampleRate),
|
||||
sequenceNumber: uint16(rand.Uint32()),
|
||||
ssrc: rand.Uint32(),
|
||||
|
@@ -22,9 +22,9 @@ type Encoder struct {
|
||||
}
|
||||
|
||||
// NewEncoder allocates an Encoder.
|
||||
func NewEncoder(relativeType uint8) (*Encoder, error) {
|
||||
func NewEncoder(payloadType uint8) (*Encoder, error) {
|
||||
return &Encoder{
|
||||
payloadType: 96 + relativeType,
|
||||
payloadType: payloadType,
|
||||
sequenceNumber: uint16(rand.Uint32()),
|
||||
ssrc: rand.Uint32(),
|
||||
initialTs: rand.Uint32(),
|
||||
|
Reference in New Issue
Block a user