Skip to content

Commit 578e932

Browse files
authored
Ignore empty opus frames. (#479)
1 parent f5afbf6 commit 578e932

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/media/opus/opus.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ func (d *decoder) SampleRate() int {
104104
}
105105

106106
func (d *decoder) WriteSample(in Sample) error {
107+
if len(in) == 0 {
108+
return nil
109+
}
107110
n, err := d.dec.Decode(in, d.buf)
108111
if err != nil {
109112
// Some workflows (concatenating opus files) can cause a suprious decoding error, so ignore small amount of corruption errors

0 commit comments

Comments
 (0)