Commit fbec58d3 authored by Jouni Paulus's avatar Jouni Paulus
Browse files

fix the wrong nchan_transport_real when coming from non-McMASA to 3-ch McM -> fix MSAN error

parent e8db1919
Loading
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -143,16 +143,17 @@ ivas_error ivas_corecoder_enc_reconfig(
    {
#ifdef MC_BITRATE_SWITCHING
        int16_t nchan_transport_real, nchan_transport_old_real;
        if ( last_mc_mode == MC_MODE_MCMASA )

        nchan_transport_old_real = nchan_transport_old;
        nchan_transport_real = st_ivas->nchan_transport;
        /* in SCE+CPE McMASA nchan_transport is still 2, fix the numbers */
        if ( hEncoderConfig->ivas_format == MC_FORMAT && last_mc_mode == MC_MODE_MCMASA )
        {
            /* in SCE+CPE McMASA nchan_transport is still 2 */
            nchan_transport_old_real = nSCE_old + CPE_CHANNELS * nCPE_old;
            nchan_transport_real = st_ivas->nSCE + CPE_CHANNELS * st_ivas->nCPE;
        }
        else
        if ( hEncoderConfig->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA )
        {
            nchan_transport_old_real = nchan_transport_old;
            nchan_transport_real = st_ivas->nchan_transport;
            nchan_transport_real = st_ivas->nSCE + CPE_CHANNELS * st_ivas->nCPE;
        }

        /* something in transport changes */
@@ -190,7 +191,7 @@ ivas_error ivas_corecoder_enc_reconfig(
        ind_list_metadata = hMetaData->ind_list; /* pointer to the beginning of the global list */

#ifdef MC_BITRATE_SWITCHING
        if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA )
        if ( hEncoderConfig->ivas_format == MC_FORMAT && last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA )
        {
            /* within McMASA we can modify the transport signals when switching */
            /* copy earlier dmx buffers */