Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e98d1f4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "legacy: Eliminate a2dp precision loss compiler warnings"

parents 5a741884 3f837784
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }
  }
+7 −6
Original line number Diff line number Diff line
@@ -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;

@@ -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 {
@@ -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);