From d24468253cea64d546a40d9594741000ccd86c95 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 30 Apr 2024 17:31:38 +0200 Subject: [PATCH] issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested; under FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK --- apps/decoder.c | 17 +++++++++++++++++ lib_com/options.h | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index de0dd8bca9..eeb2a19f20 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1704,6 +1704,15 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } + +#ifdef FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK + if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + fprintf( stderr, "Error: Output split rendering metadata file is supported for BINAURAL_SPLIT_PCM output config. only\n\n" ); + usage_dec(); + return false; + } +#endif } else { @@ -1990,6 +1999,14 @@ static ivas_error initOnFirstGoodFrame( } else { +#ifdef FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK + if ( arg.outputMdFilename == NULL ) + { + fprintf( stderr, "\nOutput split rendering metadata file not specified\n" ); + return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; + } +#endif + if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); diff --git a/lib_com/options.h b/lib_com/options.h index 43cb02520e..e1afdee81a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,7 @@ #define FIX_NUM_SUBFRAME_UPDATE #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ - +#define FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK /* VA: issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested */ /* #################### End BE switches ################################## */ -- GitLab