Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion format/rtsp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (self *Client) SendRtpKeepalive() (err error) {
fmt.Println("rtp: keep alive")
}
req := Request{
Method: "OPTIONS",
Method: "GET_PARAMETER",
Uri: self.requestUri,
}
if self.session != "" {
Expand Down
11 changes: 8 additions & 3 deletions format/ts/muxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ts
import (
"fmt"
"io"
"sync"
"time"

"github.com/deepch/vdk/av"
Expand All @@ -14,9 +15,9 @@ import (
var CodecTypes = []av.CodecType{av.H264, av.AAC}

type Muxer struct {
w io.Writer
streams map[int]*Stream

w io.Writer
streams map[int]*Stream
mutex sync.Mutex
PaddingToMakeCounterCont bool

psidata []byte
Expand Down Expand Up @@ -63,6 +64,10 @@ func (self *Muxer) newStream(idx int, codec av.CodecData) (err error) {
pid: pid,
tsw: tsio.NewTSWriter(pid),
}

defer self.mutex.Unlock()
self.mutex.Lock()

self.streams[idx] = stream
return
}
Expand Down