diff --git a/filter.go b/filter.go index 5cb8eda..211c29f 100644 --- a/filter.go +++ b/filter.go @@ -202,6 +202,8 @@ func filter_video(data C.uintptr_t, frame *C.struct_obs_source_frame) *C.struct_ for len(h.queue) > 0 && h.queue[0].DoneProcessing { h.SenderSend(h.queue[0].Buffer) h.pool.Put(h.queue[0].ImageBuffer) + + h.queue[0] = nil h.queue = h.queue[1:] } }(p) diff --git a/output.go b/output.go index 217d00e..fc761ca 100644 --- a/output.go +++ b/output.go @@ -185,6 +185,8 @@ func output_raw_video(data C.uintptr_t, frame *C.struct_video_data) { for len(h.queue) > 0 && h.queue[0].DoneProcessing { h.SenderSend(h.queue[0].Buffer) h.pool.Put(h.queue[0].ImageBuffer) + + h.queue[0] = nil h.queue = h.queue[1:] } }(p) diff --git a/source.go b/source.go index f3caac2..e9f8c5a 100644 --- a/source.go +++ b/source.go @@ -326,6 +326,7 @@ func (t *teleportSource) newPacket(p *Packet) { } } + t.queue[0] = nil t.queue = t.queue[1:] } }(p)