Skip to content

Commit

Permalink
Don't call sox_write from output effect if input buffer is empty. Thi…
Browse files Browse the repository at this point in the history
…s avoids issues with the vorbis encoder.
  • Loading branch information
erikronstrom committed Nov 25, 2019
1 parent cfc3ccc commit d05aba5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/output.c
Expand Up @@ -31,6 +31,11 @@ static int flow(sox_effect_t *effp, sox_sample_t const * ibuf,
sox_sample_t * obuf, size_t * isamp, size_t * osamp)
{
priv_t * p = (priv_t *)effp->priv;
/* Abort if there are no samples to write */
if (*isamp == 0) {
*osamp = 0;
return SOX_SUCCESS;
}
/* Write out *isamp samples */
size_t len = sox_write(p->file, ibuf, *isamp);

Expand Down

0 comments on commit d05aba5

Please sign in to comment.