From fca6833d5d5b6fc7d72067080c57ce2f74be4152 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 20 Sep 2023 12:50:25 +0200 Subject: [PATCH] hd-rum-transcode: fixed exitting on init err Fixes endless wait in hd_rum_decompress_done() when running ` hd-rum-transcode 8M 5004 nonexistent ` because the thread is not exited if registered should_exit callbacks are not run. This issue was present since 23-03-2023 (commit 449251ac or something around). --- src/hd-rum-translator/hd-rum-translator.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hd-rum-translator/hd-rum-translator.cpp b/src/hd-rum-translator/hd-rum-translator.cpp index 2d39d9171..f55bbb738 100644 --- a/src/hd-rum-translator/hd-rum-translator.cpp +++ b/src/hd-rum-translator/hd-rum-translator.cpp @@ -885,7 +885,16 @@ static void hd_rum_translator_should_exit_callback(void *arg) { *should_exit = true; } -#define EXIT(retval) { hd_rum_translator_deinit(&state); if (sock_in != nullptr) udp_exit(sock_in); common_cleanup(init); return retval; } +#define EXIT(retval) \ + { \ + exit_uv(0); \ + hd_rum_translator_deinit(&state); \ + if (sock_in != nullptr) \ + udp_exit(sock_in); \ + common_cleanup(init); \ + return retval; \ + } + int main(int argc, char **argv) { struct init_data *init;