Commit 0a5f6680 authored by vaclav's avatar vaclav
Browse files

add sanity check to avoid use of both Object editing and Non-diegetic panning features

parent 192f6705
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ typedef enum
    IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED,
    IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED,
    IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED,
#ifdef OBJECT_EDIT_FILE_INTERFACE
    IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED,
#endif
    IVAS_ERR_INVALID_HRTF,
#ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE
    IVAS_ERR_INVALID_HRTF_SAMPLING_RATE,
@@ -260,6 +263,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Acoustic environment not supported";
        case IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED:
            return "Objects editing not supported";
#ifdef OBJECT_EDIT_FILE_INTERFACE
        case IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED:
            return "Wrong use of both Object editing and Non-diegetic panning";
#endif
        case IVAS_ERR_INVALID_HRTF:
            return "Unsupported HRTF filter set";
#ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE
+8 −1
Original line number Diff line number Diff line
@@ -3239,9 +3239,16 @@ static ivas_error doSanityChecks_IVAS(
    {
        if ( !( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) )
        {
            return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Wrong set-up: Obect editing is not supported in this IVAS format." );
            return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Wrong set-up: Object editing is not supported in this IVAS format." );
        }
    }

#ifdef OBJECT_EDIT_FILE_INTERFACE
    if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on & st_ivas->hDecoderConfig->Opt_non_diegetic_pan )
    {
        return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED, "Wrong set-up: Only object editing or Non-diegetic panning can be used." );
    }
#endif
#ifdef DEBUGGING
    if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) )
    {