diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index aa004c4cc3a094b1c256d47ea4ffe01871a27b07..a901a294c128171cbf61054705e7e86560900249 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 } diff --git a/apps/renderer.c b/apps/renderer.c index dec564b69cffa5ae939825db969b01cf2583456f..c22e4dbb2c68ef40d986f0746316d6f9e1aef98d 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 80cd7a383bbd806dfa0f5fa82fac8262234d7590..388f70df4f1932e2d70d04e435de61b74ddd24c0 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 ################################## */