Skip to content

VPAAMP-245: Negative Latency value logged while HLS linear playback#1442

Open
psiva01 wants to merge 6 commits into
dev_sprint_25_2from
feature/VPAAMP-245
Open

VPAAMP-245: Negative Latency value logged while HLS linear playback#1442
psiva01 wants to merge 6 commits into
dev_sprint_25_2from
feature/VPAAMP-245

Conversation

@psiva01
Copy link
Copy Markdown
Contributor

@psiva01 psiva01 commented May 13, 2026

w/o TSB

Reason for change: EndPos is set to -1 for TSB-less playback before latency calculation. This caused latency to be negative, since HLS latency is calculated as EndPos - CurrPos. So, moved this tsbless block after latency calculation. Also, fixed start and end values in aamp pos logging.

w/o TSB

Reason for change: EndPos is set to -1 for TSB-less playback before
latency calculation. This caused latency to be negative, since HLS
latency is calculated as EndPos - CurrPos. So, moved this tsbless
block after latency calculation. Also, fixed start and end values
in aamp pos logging.

Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.com>
@psiva01 psiva01 requested a review from a team as a code owner May 13, 2026 14:58
@psiva01 psiva01 requested a review from Copilot May 13, 2026 14:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes negative live-latency reporting during TSB-less linear HLS playback by ensuring end is not overwritten to -1 until after latency is computed, and improves progress logging to correctly print sentinel -1 start/end values.

Changes:

  • Move the “TSB-less linear” start/end = -1 override to occur after live latency calculation.
  • Adjust aamp pos logging to avoid printing 0 when start/end are -1 (sentinel), while keeping normal ms→s formatting for valid values.
Comments suppressed due to low confidence (1)

priv_aamp.cpp:2819

  • New code introduces C-style casts when converting ms to seconds (e.g., (long)(val / 1000) and (long)(reportFormattedCurrPos / 1000)). Prefer static_cast<long>(...) for safer, more explicit C++ casting in this file.
					auto format_pos = [](double val) -> long {
						return (val == -1.0) ? -1 : (long)(val / 1000);
					};
					AAMPLOG_MIL("aamp pos: [%ld..%ld..%ld..%lld..%.2f..%.2f..%.2f..%s..%" BITSPERSECOND_FORMAT "..%" BITSPERSECOND_FORMAT "..%.2f]",
							format_pos(start),
							(long)(reportFormattedCurrPos / 1000),
							format_pos(end),

Comment thread priv_aamp.cpp Outdated
Comment thread priv_aamp.cpp Outdated
Comment thread priv_aamp.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants