mirror of
https://github.com/pion/webrtc.git
synced 2025-10-28 17:41:49 +08:00
Gstreamer: avoid lock contention with pipeline
Stop one pipeline from preventing others from sending data if it wasn't being serviced
This commit is contained in:
@@ -93,9 +93,10 @@ const (
|
|||||||
//export goHandlePipelineBuffer
|
//export goHandlePipelineBuffer
|
||||||
func goHandlePipelineBuffer(buffer unsafe.Pointer, bufferLen C.int, duration C.int, pipelineID C.int) {
|
func goHandlePipelineBuffer(buffer unsafe.Pointer, bufferLen C.int, duration C.int, pipelineID C.int) {
|
||||||
pipelinesLock.Lock()
|
pipelinesLock.Lock()
|
||||||
defer pipelinesLock.Unlock()
|
pipeline, ok := pipelines[int(pipelineID)]
|
||||||
|
pipelinesLock.Unlock()
|
||||||
|
|
||||||
if pipeline, ok := pipelines[int(pipelineID)]; ok {
|
if ok {
|
||||||
var samples uint32
|
var samples uint32
|
||||||
if pipeline.codecName == webrtc.Opus {
|
if pipeline.codecName == webrtc.Opus {
|
||||||
samples = uint32(audioClockRate * (float32(duration) / 1000000000))
|
samples = uint32(audioClockRate * (float32(duration) / 1000000000))
|
||||||
|
|||||||
Reference in New Issue
Block a user