mirror of
https://github.com/pion/webrtc.git
synced 2025-10-04 14:53:05 +08:00
Make onNegotiationNeeded conform to spec
- Removes non-canon logic
This commit is contained in:
@@ -16,11 +16,19 @@ type operations struct {
|
||||
mu sync.Mutex
|
||||
busy bool
|
||||
ops *list.List
|
||||
|
||||
updateNegotiationNeededFlagOnEmptyChain *atomicBool
|
||||
onNegotiationNeeded func()
|
||||
}
|
||||
|
||||
func newOperations() *operations {
|
||||
func newOperations(
|
||||
updateNegotiationNeededFlagOnEmptyChain *atomicBool,
|
||||
onNegotiationNeeded func(),
|
||||
) *operations {
|
||||
return &operations{
|
||||
ops: list.New(),
|
||||
ops: list.New(),
|
||||
updateNegotiationNeededFlagOnEmptyChain: updateNegotiationNeededFlagOnEmptyChain,
|
||||
onNegotiationNeeded: onNegotiationNeeded,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,4 +101,9 @@ func (o *operations) start() {
|
||||
fn()
|
||||
fn = o.pop()
|
||||
}
|
||||
if !o.updateNegotiationNeededFlagOnEmptyChain.get() {
|
||||
return
|
||||
}
|
||||
o.updateNegotiationNeededFlagOnEmptyChain.set(false)
|
||||
o.onNegotiationNeeded()
|
||||
}
|
||||
|
Reference in New Issue
Block a user