mutext on ts/muxer and get_parameter for keep alive
This commit is contained in:
parent
061613f0e1
commit
d22f3dc929
@ -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 != "" {
|
||||
|
@ -3,6 +3,7 @@ package ts
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/deepch/vdk/av"
|
||||
@ -16,7 +17,7 @@ var CodecTypes = []av.CodecType{av.H264, av.AAC}
|
||||
type Muxer struct {
|
||||
w io.Writer
|
||||
streams map[int]*Stream
|
||||
|
||||
mutex sync.Mutex
|
||||
PaddingToMakeCounterCont bool
|
||||
|
||||
psidata []byte
|
||||
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user