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

Commit 5125da5d authored by En-Shuo Hsu's avatar En-Shuo Hsu
Browse files

floss: metrics: Fix pkt loss metrics

Zero lost frames should be legal.
Lower log level for the noisy corrupted mSBC packet log.

BUG: 239978865
Tag: #floss
Test: ./build.py
Test: emerge-${BOARD} floss
Test: gd/cert/run
Change-Id: I4dc5f565e88c5157c92a8023951f4993690f61ff
parent 0ddfdb09
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -493,7 +493,7 @@ struct tBTM_MSBC_INFO {

  const uint8_t* find_msbc_pkt_head() {
    if (read_corrupted) {
      LOG_WARN("Skip corrupted mSBC packets");
      LOG_DEBUG("Skip corrupted mSBC packets");
      read_corrupted = false;
      return nullptr;
    }
@@ -597,7 +597,7 @@ bool fill_plc_stats(int* num_decoded_frames, double* packet_loss_ratio) {

  int decoded_frames = msbc_info->plc->get_num_decoded_frames();
  int lost_frames = msbc_info->plc->get_num_lost_frames();
  if (decoded_frames <= 0 || lost_frames <= 0 || lost_frames > decoded_frames)
  if (decoded_frames <= 0 || lost_frames < 0 || lost_frames > decoded_frames)
    return false;

  *num_decoded_frames = decoded_frames;