Skip to content

Commit

Permalink
Make sure the final frames are flushed to the encoder.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Aug 5, 2024
1 parent c58c863 commit 80fb295
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xLights/AudioManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3511,6 +3511,10 @@ bool AudioManager::EncodeAudio(const std::vector<float>& left_channel,
#endif
return false;
}
if (sample_index >= left_channel.size()) {
// at the end, flush everything
avcodec_send_frame(codec_context, nullptr);
}

// Receive the encoded packets
while (ret >= 0) {
Expand Down

0 comments on commit 80fb295

Please sign in to comment.