mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
ringbuffer: consume buffer before closing
This commit is contained in:
@@ -46,11 +46,15 @@ func TestClose(t *testing.T) {
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
defer close(done)
|
||||
|
||||
_, ok := r.Pull()
|
||||
require.Equal(t, true, ok)
|
||||
|
||||
_, ok = r.Pull()
|
||||
require.Equal(t, false, ok)
|
||||
}()
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
r.Push([]byte{0x01, 0x02, 0x03, 0x04})
|
||||
|
||||
r.Close()
|
||||
<-done
|
||||
|
Reference in New Issue
Block a user