From 6fd00f4c4ddde7b978bd7dd3a4953b23df7a2d30 Mon Sep 17 00:00:00 2001 From: Aaron Gember-Jacobson Date: Wed, 6 Aug 2025 11:21:57 -0400 Subject: [PATCH] Properly terminate player when SIGTERM or SIGINT is received --- player/display_to_screen.cpp | 6 +++--- player/main.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/player/display_to_screen.cpp b/player/display_to_screen.cpp index 2d549c8..19ea033 100644 --- a/player/display_to_screen.cpp +++ b/player/display_to_screen.cpp @@ -119,10 +119,10 @@ void display_to_screen() // av_frame_ref(pAVFrameHold, pAVFrame); pAVFrameHold = av_frame_clone(pAVFrame); } - } - av_frame_free(&pAVFrame); + av_frame_free(&pAVFrame); + } } SDL_Quit(); -} \ No newline at end of file +} diff --git a/player/main.cpp b/player/main.cpp index 0523528..b7911bb 100644 --- a/player/main.cpp +++ b/player/main.cpp @@ -33,6 +33,7 @@ void signal_handler(int signum) if (signum == SIGINT || signum == SIGTERM) { gExitSignal = true; + frameQueue.stop_queue(); } } @@ -75,4 +76,4 @@ int main(int argc, char **argv) frameQueue.stop_queue(); return 0; -} \ No newline at end of file +}