From d1256b5de51aa009ccb2046fd318777efc72618a Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Jun 2025 12:24:07 +0200 Subject: [PATCH 1/2] FIX_1335_EXTREND_RETCODE alternative --- apps/renderer.c | 11 +++++++++++ lib_com/options.h | 1 + 2 files changed, 12 insertions(+) diff --git a/apps/renderer.c b/apps/renderer.c index 1fb83acc5a..3c2808866a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -659,6 +659,9 @@ int main( int argc, char **argv ) { +#ifdef FIX_1335_EXTREND_RETCODE + bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */ +#endif IVAS_REND_HANDLE hIvasRend = NULL; RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; @@ -1965,6 +1968,10 @@ int main( * Close files and deallocate resources *------------------------------------------------------------------------------------------*/ +#ifdef FIX_1335_EXTREND_RETCODE + mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ + +#endif cleanup: free( inpInt16Buffer ); @@ -2021,7 +2028,11 @@ cleanup: print_mem( NULL ); #endif +#ifdef FIX_1335_EXTREND_RETCODE + return mainFailed ? -1 : 0; +#else return 0; +#endif } diff --git a/lib_com/options.h b/lib_com/options.h index 80cd7a383b..388f70df4f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ +#define FIX_1335_EXTREND_RETCODE /* FhG: Add modification of returncode for external renderer when an error occurs */ /* #################### End BE switches ################################## */ -- GitLab From 71e9531ad0614f21f000e236159d2bcb8db20c38 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Jun 2025 12:30:02 +0200 Subject: [PATCH 2/2] apply the same fix to isar-post-rend application --- apps/isar_post_rend.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index aa004c4cc3..a901a294c1 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -681,6 +681,9 @@ int main( int argc, char **argv ) { +#ifdef FIX_1335_EXTREND_RETCODE + bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */ +#endif ISAR_POST_REND_HANDLE hIsarPostRend = NULL; RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; @@ -1222,6 +1225,10 @@ int main( * Close files and deallocate resources *------------------------------------------------------------------------------------------*/ +#ifdef FIX_1335_EXTREND_RETCODE + mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ + +#endif cleanup: free( inpInt16Buffer ); @@ -1252,7 +1259,11 @@ cleanup: print_mem( NULL ); #endif +#ifdef FIX_1335_EXTREND_RETCODE + return mainFailed ? -1 : 0; +#else return 0; +#endif } -- GitLab