From 391bc2441f59e4d6f750fd85d5567de7036efad5 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 6 Sep 2020 14:53:42 +0200 Subject: [PATCH] unexport ConnClient.WriteFrame --- conn-client.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/conn-client.go b/conn-client.go index 70c680fc..33dd8aa6 100644 --- a/conn-client.go +++ b/conn-client.go @@ -234,8 +234,9 @@ func (c *ConnClient) Do(req *Request) (*Response, error) { return res, nil } -// WriteFrame writes an InterleavedFrame. -func (c *ConnClient) WriteFrame(frame *InterleavedFrame) error { +// this can't be exported +// otherwise there's a race condition with the rtcp receiver report routine +func (c *ConnClient) writeFrame(frame *InterleavedFrame) error { c.nconn.SetWriteDeadline(time.Now().Add(c.conf.WriteTimeout)) return frame.Write(c.bw) } @@ -603,7 +604,7 @@ func (c *ConnClient) Play(u *url.URL) (*Response, error) { }) } else { - c.WriteFrame(&InterleavedFrame{ + c.writeFrame(&InterleavedFrame{ TrackId: trackId, StreamType: StreamTypeRtcp, Content: frame,