Skip to content

Commit d05aba5

Browse files
committed
Don't call sox_write from output effect if input buffer is empty. This avoids issues with the vorbis encoder.
1 parent cfc3ccc commit d05aba5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/output.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ static int flow(sox_effect_t *effp, sox_sample_t const * ibuf,
3131
sox_sample_t * obuf, size_t * isamp, size_t * osamp)
3232
{
3333
priv_t * p = (priv_t *)effp->priv;
34+
/* Abort if there are no samples to write */
35+
if (*isamp == 0) {
36+
*osamp = 0;
37+
return SOX_SUCCESS;
38+
}
3439
/* Write out *isamp samples */
3540
size_t len = sox_write(p->file, ibuf, *isamp);
3641

0 commit comments

Comments
 (0)