mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
add CreateDecoder() method to all tracks that can be decoded
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/aler9/gortsplib"
|
||||
"github.com/aler9/gortsplib/pkg/rtpmpeg4audio"
|
||||
"github.com/aler9/gortsplib/pkg/url"
|
||||
)
|
||||
|
||||
@@ -49,13 +48,7 @@ func main() {
|
||||
}
|
||||
|
||||
// setup decoder
|
||||
dec := &rtpmpeg4audio.Decoder{
|
||||
SampleRate: track.Config.SampleRate,
|
||||
SizeLength: track.SizeLength,
|
||||
IndexLength: track.IndexLength,
|
||||
IndexDeltaLength: track.IndexDeltaLength,
|
||||
}
|
||||
dec.Init()
|
||||
dec := track.CreateDecoder()
|
||||
|
||||
// called when a RTP packet arrives
|
||||
c.OnPacketRTP = func(ctx *gortsplib.ClientOnPacketRTPCtx) {
|
||||
|
Reference in New Issue
Block a user