Skip to content

Commit

Permalink
停止時に eos を書き込んでから終わらせるために、writer の順番を変更する
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexa committed Jan 6, 2025
1 parent 386af77 commit b059720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ func opus2ogg(ctx context.Context, opusCh chan opusChannel, sampleRate uint32, c
oggReader, oggWriter := io.Pipe()

writers := []io.Writer{}
writers = append(writers, oggWriter)

var f *os.File
if c.EnableOggFileOutput {
Expand All @@ -481,6 +480,7 @@ func opus2ogg(ctx context.Context, opusCh chan opusChannel, sampleRate uint32, c
}
writers = append(writers, f)
}
writers = append(writers, oggWriter)

multiWriter := io.MultiWriter(writers...)

Expand Down

0 comments on commit b059720

Please sign in to comment.