Loading system/btif/src/btif_a2dp_source.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1325,7 +1325,7 @@ static void btif_a2dp_source_update_metrics(void) { metrics.buffer_underruns_average = 0; if (metrics.buffer_underruns_count > 0) { metrics.buffer_underruns_average = stats.media_read_total_underflow_bytes / (float)stats.media_read_total_underflow_bytes / metrics.buffer_underruns_count; } } Loading system/stack/a2dp/a2dp_sbc_encoder.cc +7 −6 Original line number Diff line number Diff line Loading @@ -411,12 +411,12 @@ static void a2dp_sbc_get_num_frame_iteration(uint8_t* num_of_iterations, a2dp_sbc_encoder_cb.feeding_state.last_frame_us = now_us; a2dp_sbc_encoder_cb.feeding_state.counter += (float)a2dp_sbc_encoder_cb.feeding_state.bytes_per_tick * us_this_tick / (A2DP_SBC_ENCODER_INTERVAL_MS * 1000); (float)a2dp_sbc_encoder_cb.feeding_state.bytes_per_tick * (float)us_this_tick / (A2DP_SBC_ENCODER_INTERVAL_MS * 1000); /* Calculate the number of frames pending for this media tick */ projected_nof = a2dp_sbc_encoder_cb.feeding_state.counter / pcm_bytes_per_frame; a2dp_sbc_encoder_cb.feeding_state.counter / (float)pcm_bytes_per_frame; // Update the stats a2dp_sbc_encoder_cb.stats.media_read_total_expected_frames += projected_nof; Loading Loading @@ -453,7 +453,7 @@ static void a2dp_sbc_get_num_frame_iteration(uint8_t* num_of_iterations, noi, A2DP_SBC_MAX_PCM_ITER_NUM_PER_TICK); noi = A2DP_SBC_MAX_PCM_ITER_NUM_PER_TICK; a2dp_sbc_encoder_cb.feeding_state.counter = noi * nof * pcm_bytes_per_frame; noi * nof * (float)pcm_bytes_per_frame; } projected_nof = nof; } else { Loading @@ -475,11 +475,12 @@ static void a2dp_sbc_get_num_frame_iteration(uint8_t* num_of_iterations, projected_nof = MAX_PCM_FRAME_NUM_PER_TICK; a2dp_sbc_encoder_cb.feeding_state.counter = noi * projected_nof * pcm_bytes_per_frame; (float)noi * (float)projected_nof * (float)pcm_bytes_per_frame; } nof = projected_nof; } a2dp_sbc_encoder_cb.feeding_state.counter -= noi * nof * pcm_bytes_per_frame; a2dp_sbc_encoder_cb.feeding_state.counter -= noi * nof * (float)pcm_bytes_per_frame; LOG_VERBOSE("%s: effective num of frames %u, iterations %u", __func__, nof, noi); Loading Loading
system/btif/src/btif_a2dp_source.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1325,7 +1325,7 @@ static void btif_a2dp_source_update_metrics(void) { metrics.buffer_underruns_average = 0; if (metrics.buffer_underruns_count > 0) { metrics.buffer_underruns_average = stats.media_read_total_underflow_bytes / (float)stats.media_read_total_underflow_bytes / metrics.buffer_underruns_count; } } Loading
system/stack/a2dp/a2dp_sbc_encoder.cc +7 −6 Original line number Diff line number Diff line Loading @@ -411,12 +411,12 @@ static void a2dp_sbc_get_num_frame_iteration(uint8_t* num_of_iterations, a2dp_sbc_encoder_cb.feeding_state.last_frame_us = now_us; a2dp_sbc_encoder_cb.feeding_state.counter += (float)a2dp_sbc_encoder_cb.feeding_state.bytes_per_tick * us_this_tick / (A2DP_SBC_ENCODER_INTERVAL_MS * 1000); (float)a2dp_sbc_encoder_cb.feeding_state.bytes_per_tick * (float)us_this_tick / (A2DP_SBC_ENCODER_INTERVAL_MS * 1000); /* Calculate the number of frames pending for this media tick */ projected_nof = a2dp_sbc_encoder_cb.feeding_state.counter / pcm_bytes_per_frame; a2dp_sbc_encoder_cb.feeding_state.counter / (float)pcm_bytes_per_frame; // Update the stats a2dp_sbc_encoder_cb.stats.media_read_total_expected_frames += projected_nof; Loading Loading @@ -453,7 +453,7 @@ static void a2dp_sbc_get_num_frame_iteration(uint8_t* num_of_iterations, noi, A2DP_SBC_MAX_PCM_ITER_NUM_PER_TICK); noi = A2DP_SBC_MAX_PCM_ITER_NUM_PER_TICK; a2dp_sbc_encoder_cb.feeding_state.counter = noi * nof * pcm_bytes_per_frame; noi * nof * (float)pcm_bytes_per_frame; } projected_nof = nof; } else { Loading @@ -475,11 +475,12 @@ static void a2dp_sbc_get_num_frame_iteration(uint8_t* num_of_iterations, projected_nof = MAX_PCM_FRAME_NUM_PER_TICK; a2dp_sbc_encoder_cb.feeding_state.counter = noi * projected_nof * pcm_bytes_per_frame; (float)noi * (float)projected_nof * (float)pcm_bytes_per_frame; } nof = projected_nof; } a2dp_sbc_encoder_cb.feeding_state.counter -= noi * nof * pcm_bytes_per_frame; a2dp_sbc_encoder_cb.feeding_state.counter -= noi * nof * (float)pcm_bytes_per_frame; LOG_VERBOSE("%s: effective num of frames %u, iterations %u", __func__, nof, noi); Loading