Skip to content

Commit

Permalink
Small fix in err check
Browse files Browse the repository at this point in the history
  • Loading branch information
zaf committed Feb 16, 2020
1 parent 5e5babc commit 1b57298
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resample.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (r *Resampler) Write(p []byte) (i int, err error) {
i = int(float64(written) * (r.inRate / r.outRate))
// If we have read all input and flushed all output, avoid to report short writes due
// to output frames missing because of downsampling or other odd reasons.
if err != nil && framesIn == int(read) && framesOut == int(done) {
if err == nil && framesIn == int(read) && framesOut == int(done) {
i = len(p)
}

Expand Down

0 comments on commit 1b57298

Please sign in to comment.