Cleanup replay packets after use

This commit is contained in:
dec05eba 2023-04-03 10:39:57 +02:00
parent e301925d98
commit 10d7bf93e8

View File

@ -2048,6 +2048,10 @@ int main(int argc, char **argv) {
if(save_replay_thread.valid() && save_replay_thread.wait_for(std::chrono::seconds(0)) == std::future_status::ready) {
save_replay_thread.get();
puts(save_replay_output_filepath.c_str());
std::lock_guard<std::mutex> lock(write_output_mutex);
for(AVPacket &packet : save_replay_packets) {
av_packet_unref(&packet);
}
save_replay_packets.clear();
}
@ -2068,6 +2072,11 @@ int main(int argc, char **argv) {
if(save_replay_thread.valid()) {
save_replay_thread.get();
puts(save_replay_output_filepath.c_str());
std::lock_guard<std::mutex> lock(write_output_mutex);
for(AVPacket &packet : save_replay_packets) {
av_packet_unref(&packet);
}
save_replay_packets.clear();
}
for(AudioTrack &audio_track : audio_tracks) {