Commit 0cbfa7b0 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Write out disk writer packets unconditionally.

If the stream was very short, we may not have created
a writer yet.  Write out packets even in that case.
parent e8fbfcb9
...@@ -184,8 +184,8 @@ func (conn *diskConn) warn(message string) { ...@@ -184,8 +184,8 @@ func (conn *diskConn) warn(message string) {
// called locked // called locked
func (conn *diskConn) reopen(extension string) error { func (conn *diskConn) reopen(extension string) error {
for _, t := range conn.tracks { for _, t := range conn.tracks {
t.writeBuffered(true)
if t.writer != nil { if t.writer != nil {
t.writeBuffered(true)
t.writer.Close() t.writer.Close()
t.writer = nil t.writer = nil
} }
...@@ -207,8 +207,8 @@ func (conn *diskConn) Close() error { ...@@ -207,8 +207,8 @@ func (conn *diskConn) Close() error {
conn.mu.Lock() conn.mu.Lock()
tracks := make([]*diskTrack, 0, len(conn.tracks)) tracks := make([]*diskTrack, 0, len(conn.tracks))
for _, t := range conn.tracks { for _, t := range conn.tracks {
t.writeBuffered(true)
if t.writer != nil { if t.writer != nil {
t.writeBuffered(true)
t.writer.Close() t.writer.Close()
t.writer = nil t.writer = nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment