Skip to content

Commit 44e9bd4

Browse files
SakoramCopilot
andcommitted
Update lib/src/st2110/st_tx_video_session.c
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d2c0303 commit 44e9bd4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/src/st2110/st_tx_video_session.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,18 @@ static int tv_train_pacing(struct mtl_main_impl* impl, struct st_tx_video_sessio
427427
pkts_per_frame = pkts_per_frame * reactive;
428428
measured_bps = s->st20_pkt_size * pkts_per_sec * reactive;
429429

430-
/* If the measured speed is lower then expected. Set higher bps and retrain to add
430+
/* If the measured speed is lower than expected. Set higher bps and retrain to add
431431
* padding */
432432
if (measured_bps < rl_bps) {
433-
info("%s(%d), measured bps %ld is lower then set bps %ld\n", __func__, idx,
434-
(uint64_t)measured_bps, rl_bps);
433+
info("%s(%d), measured bps %"PRIu64" is lower then set bps %"PRIu64"\n",
434+
__func__, idx, (uint64_t)measured_bps, rl_bps);
435435
if (!mt_pacing_train_bps_result_search(impl, port, rl_bps, &bps_to_set)) {
436436
err("%s(%d), measured speed is too low on already trained bps\n", __func__, idx);
437437
return -EINVAL;
438438
}
439439

440-
bps_to_set = rl_bps / measured_bps * rl_bps;
441-
info("%s(%d), increase bps to %ld\n", __func__, idx, bps_to_set);
440+
bps_to_set = (rl_bps * rl_bps) / measured_bps;
441+
info("%s(%d), increase bps to %"PRIu64"\n", __func__, idx, bps_to_set);
442442
mt_pacing_train_bps_result_add(impl, port, rl_bps, bps_to_set);
443443
mt_txq_set_tx_bps(queue, bps_to_set);
444444
ret = tv_train_pacing(impl, s, s_port);

0 commit comments

Comments
 (0)