diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index a92b251..6b794ad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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) { |