Skip to content

Commit

Permalink
Update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok committed Jan 15, 2021
1 parent 3aae44e commit 07da48d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions torchaudio/csrc/sox/effects_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int fileobj_input_drain(sox_effect_t* effp, sox_sample_t* obuf, size_t* osamp) {
const auto num_consumed = sf->tell_off;
const auto num_remain = priv->buffer_size - num_consumed;

// 1.1. First, we fetch the data to see if there is data to fill the buffer
// 1.1. Fetch the data to see if there is data to fill the buffer
uint64_t num_refill = 0;
std::string chunk;
if (num_consumed && !priv->read_finished) {
Expand Down Expand Up @@ -388,7 +388,8 @@ int fileobj_input_drain(sox_effect_t* effp, sox_sample_t* obuf, size_t* osamp) {
// store the actual number read back to *osamp
*osamp = sox_read(sf, obuf, *osamp);

return (!*osamp && priv->read_finished) ? SOX_EOF : SOX_SUCCESS;
// Decoding is finished when fileobject is exhausted and sox can no longer decode a sample.
return (priv->read_finished && !*osamp) ? SOX_EOF : SOX_SUCCESS;
}

int fileobj_output_flow(
Expand Down

0 comments on commit 07da48d

Please sign in to comment.