mirror of
https://github.com/jech/galene.git
synced 2024-11-10 02:35:58 +01:00
Maintain a reference to client in disk connections.
This commit is contained in:
parent
d43a2b0104
commit
d9dbb50bf5
1 changed files with 4 additions and 2 deletions
|
@ -119,7 +119,7 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c
|
||||||
client.down = make(map[string]*diskConn)
|
client.down = make(map[string]*diskConn)
|
||||||
}
|
}
|
||||||
|
|
||||||
down, err := newDiskConn(directory, label, up, tracks)
|
down, err := newDiskConn(client, directory, label, up, tracks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,7 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c
|
||||||
}
|
}
|
||||||
|
|
||||||
type diskConn struct {
|
type diskConn struct {
|
||||||
|
client *Client
|
||||||
directory string
|
directory string
|
||||||
label string
|
label string
|
||||||
hasVideo bool
|
hasVideo bool
|
||||||
|
@ -218,8 +219,9 @@ type diskTrack struct {
|
||||||
lastKf uint32
|
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{
|
conn := diskConn{
|
||||||
|
client: client,
|
||||||
directory: directory,
|
directory: directory,
|
||||||
label: label,
|
label: label,
|
||||||
tracks: make([]*diskTrack, 0, len(remoteTracks)),
|
tracks: make([]*diskTrack, 0, len(remoteTracks)),
|
||||||
|
|
Loading…
Reference in a new issue