Commit 2cd6b8a2 authored by vaclav's avatar vaclav
Browse files

EXT output: rearrange channels order to match the input file channel order

parents 6fabfe47 2ccb55e9
Loading
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -2282,8 +2282,6 @@ static ivas_error decodeG192(
            {
                fprintf( stdout, "\nOutput ISM metadata file:   %s", IsmFileWriter_getFilePath( ismWriters[i] ) );
            }
            fprintf( stdout, "\n" );

            fprintf( stdout, "\nOutput MASA metadata file:  %s\n", MasaFileWriter_getFilePath( masaWriter ) );
        }
#endif
@@ -3485,8 +3483,6 @@ static ivas_error decodeVariableSpeed(
            {
                fprintf( stdout, "\nOutput ISM metadata file:   %s", IsmFileWriter_getFilePath( ismWriters[i] ) );
            }
            fprintf( stdout, "\n" );

            fprintf( stdout, "\nOutput MASA metadata file:  %s\n", MasaFileWriter_getFilePath( masaWriter ) );
        }
#endif
+22 −0
Original line number Diff line number Diff line
@@ -588,6 +588,28 @@ ivas_error ivas_dec(
        {
            ivas_omasa_dirac_rend( st_ivas, output, output_frame );
        }

#ifdef OMASA_EXT_OUTPUT
        if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL )
        {
            /* sanity check in case of bitrate switching */
            if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC )
            {
                return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" );
            }

            /* in case of external rendering, rearrange the channels order */
            mvr2r( output[0], output[MAX_OUTPUT_CHANNELS - 2], output_frame );
            mvr2r( output[1], output[MAX_OUTPUT_CHANNELS - 1], output_frame );

            for ( n = 0; n < nchan_transport_ism; n++ )
            {
                mvr2r( output[st_ivas->nchan_transport + n], output[n], output_frame );
            }
            mvr2r( output[MAX_OUTPUT_CHANNELS - 2], output[n], output_frame );
            mvr2r( output[MAX_OUTPUT_CHANNELS - 1], output[++n], output_frame );
        }
#endif
    }
#endif
    else if ( st_ivas->ivas_format == MC_FORMAT )