Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
leng-yue authored Sep 10, 2024
1 parent c26375d commit 60dfebe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,12 @@ class OpusBufferedEncoder
throw py::value_error("Encoding failed");
}

has_written = true;

unsigned char *packet;
opus_int32 len;
while (ope_encoder_get_page(encoder, &packet, &len, 1) != 0)
{
encoded_data.insert(encoded_data.end(), packet, packet + len);
has_written = true;
}

return py::bytes(reinterpret_cast<char *>(encoded_data.data()), encoded_data.size());
Expand Down

0 comments on commit 60dfebe

Please sign in to comment.