From d9dbb50bf57d8231e6eb8b222a0446cdac79f83c Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 23 Dec 2020 21:48:02 +0100 Subject: [PATCH] Maintain a reference to client in disk connections. --- diskwriter/diskwriter.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/diskwriter/diskwriter.go b/diskwriter/diskwriter.go index 96ecc7e..5f1b6e6 100644 --- a/diskwriter/diskwriter.go +++ b/diskwriter/diskwriter.go @@ -119,7 +119,7 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c client.down = make(map[string]*diskConn) } - down, err := newDiskConn(directory, label, up, tracks) + down, err := newDiskConn(client, directory, label, up, tracks) if err != nil { return err } @@ -129,6 +129,7 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c } type diskConn struct { + client *Client directory string label string hasVideo bool @@ -218,8 +219,9 @@ type diskTrack struct { lastKf uint32 } -func newDiskConn(directory, label string, up conn.Up, remoteTracks []conn.UpTrack) (*diskConn, error) { +func newDiskConn(client *Client, directory, label string, up conn.Up, remoteTracks []conn.UpTrack) (*diskConn, error) { conn := diskConn{ + client: client, directory: directory, label: label, tracks: make([]*diskTrack, 0, len(remoteTracks)),