Commit 8591a629 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] bug with parsing custom layout files specified in the scene description...

[fix] bug with parsing custom layout files specified in the scene description file (addresses TODO added in e2326bb1)
parent 3c89c7fe
Loading
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -1960,12 +1960,11 @@ LfeRoutingConfig *LfeRoutingConfig_open(
void LfeRoutingConfig_close(
    LfeRoutingConfig *lfeRoutingCfg )
{
    if ( lfeRoutingCfg == NULL )
    if ( lfeRoutingCfg != NULL )
    {
        assert( !"Can't close LfeRoutingConfig - pointer is NULL" );
    }

        free( lfeRoutingCfg );
    }

    return;
}
@@ -2488,10 +2487,28 @@ static void parseMc(

    readNextMetadataChunk( line, "\n" );
    IVAS_REND_AudioConfig cfg = parseAudioConfig( line );
    if ( cfg == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) // TODO tmu : cfg is never parsed as custom LS?
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    /* Try to use the given string as a path to a custom loudspeaker layout file. */
    if ( cfg == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
    {
        ivas_error error = parseCustomLayoutFile( line, &inConfig->inSetupCustom );

        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error while parsing input format %s\n", line );
            exit( -1 );
        }
        inConfig->numMultiChannelBuses = 1;
        inConfig->multiChannelBuses[idx].audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM;
        inConfig->multiChannelBuses[idx].inputChannelIndex = 0;
        inConfig->multiChannelBuses[idx].gain_dB = 0.0f;
    }
#else
    if ( cfg == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
    {
        parseCustomLayoutFile( line, &inConfig->inSetupCustom );
    }
#endif
    else
    {
        inConfig->multiChannelBuses[idx].audioConfig = cfg;