diff --git a/apps/renderer.c b/apps/renderer.c index 8ef8a988bddb356d6d3e31ce4c83210a13bf2e26..deda26e8ae45228a17661fbad7d7b0a9b2bdd4a4 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -564,12 +564,27 @@ static void setupWithSingleFormatInput( positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) { +#ifdef FIX_1376_MISSING_ISM_METADATA + /* Check if path to metadata file was given */ + if ( isEmptyString( args.inMetadataFilePaths[i] ) ) + { + fprintf( stderr, "No metadata file was given for ISM input %d\n", i ); + exit( -1 ); + } + + /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string contains "NULL" */ +#else /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */ +#endif char charBuf[FILENAME_MAX]; strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 ); charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0'; to_upper( charBuf ); +#ifdef FIX_1376_MISSING_ISM_METADATA + if ( strncmp( charBuf, "NULL", 4 ) == 0 ) +#else if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 ) +#endif { continue; } @@ -2595,7 +2610,11 @@ static CmdlnArgs defaultArgs( args.outConfig.outSetupCustom.num_lfe = 0; args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; +#ifdef FIX_1376_MISSING_ISM_METADATA + for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) +#else for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) +#endif { clearString( args.inMetadataFilePaths[i] ); } diff --git a/lib_com/options.h b/lib_com/options.h index e6081dee4f287d5e9ea6ccb79bcf223651998ea0..32c2722e32967161a6223c4ef0ec5d2dddf7d4fc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,6 +165,7 @@ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ #define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ +#define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ /* #################### End BE switches ################################## */ diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 29ee307fad470b1b3234fcda772250720dd255e4..657b1aa61627b13dee952d974ded3e7614afaec4 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -273,6 +273,13 @@ def run_renderer( if in_meta_files is None and in_fmt in format_to_metadata_files: in_meta_files = format_to_metadata_files[in_fmt] + # If metadata not given with ISM input, use default NULL + if in_meta_files is None and isinstance(in_fmt, str) and "ism" in in_fmt.lower(): + match = re.search(r"ism(\d)", in_fmt.lower()) + assert match is not None + num_obj = int(match[1]) + in_meta_files = ["NULL"] * num_obj + if out_file is None: out_file_stem = f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{hrtf_file_name}{name_extension}{aeid_name}_{sr}.wav" out_file = str(output_path_base.joinpath(out_file_stem))