Commit d77b6bdb authored by hsd's avatar hsd
Browse files

fix vs warning "potentially uninitialized local variable 'payload'" by making...

fix vs warning "potentially uninitialized local variable 'payload'" by making sure we only reinitialize on good frames
parent 21b250ef
Loading
Loading
Loading
Loading
Loading
+16 −17
Original line number Diff line number Diff line
@@ -639,23 +639,6 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal(
                return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (number of media times per frame data block) in bitstream is only supported when the ISAR frame duration stays the same\n" );
            }
        }
#else
        if ( payload.frame_duration_us != handle->config.lc3plus_frame_duration_us )
        {
            return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (frame duration) in bitstream is not supported\n" );
        }
        if ( payload.high_resolution_enabled != handle->config.high_res_mode_enabled )
        {
            return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (high resolution mode) in bitstream is not supported\n" );
        }
        if ( payload.num_media_times != config_num_media_times )
        {
            return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (number of media times per frame data block) in bitstream is not supported\n" );
        }
#endif
    }

#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
        if ( reInitRequired )
        {
            isar_lc3plus_dec_deinit_handle( handle );
@@ -672,7 +655,23 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal(
                return IVAS_ERROR( err, "ISAR_LC3PLUS_DEC_Open failed\n" );
            }
        }
#else
        if ( payload.frame_duration_us != handle->config.lc3plus_frame_duration_us )
        {
            return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (frame duration) in bitstream is not supported\n" );
        }
        if ( payload.high_resolution_enabled != handle->config.high_res_mode_enabled )
        {
            return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (high resolution mode) in bitstream is not supported\n" );
        }
        if ( payload.num_media_times != config_num_media_times )
        {
            return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (number of media times per frame data block) in bitstream is not supported\n" );
        }
#endif
    }

#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
    config_num_media_times = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us;
#endif
    numSamplesPerLC3plusChannel = (int16_t) ( handle->config.samplerate / ( 1000000 / handle->config.isar_frame_duration_us ) / config_num_media_times );