Repository navigation
fix(audio): native playback stretches where audio arrives, and reports A/V lag #8361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
836ab77
e67ad6b
5f5e107
99db817
5a5f553
08b0d2f
ea9ac33
b93e1d1
cc20984
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,8 @@ | |
| //! and meanings, so its analyzer reduces a native run exactly as it does a | ||
| //! browser one. Durations are milliseconds as floats. `at` is this process's | ||
| //! monotonic clock from the first sample, `render` the device's clock, and | ||
| //! `timestamp` the media clock; fields this player cannot read are left out | ||
| //! `timestamp` the media clock, with `clock` where the presentation clock video | ||
| //! plays from stands on it at the same instant; fields this player cannot read are left out | ||
| //! rather than written as zero. `comfort` and `utterances` have no browser | ||
| //! counterpart: they show how a declared silence played, for push-to-talk. | ||
|
|
||
|
|
@@ -39,6 +40,8 @@ struct Sample { | |
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| timestamp: Option<f64>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| clock: Option<f64>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| stalled: Option<bool>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| delay: Option<f64>, | ||
|
|
@@ -241,11 +244,13 @@ impl Metrics { | |
| // Read straight after the device clock, so the two pair up. | ||
| let now = Instant::now(); | ||
| let (playhead, delay) = (self.playhead.at(now), self.presentation.delay()); | ||
| let clock = self.presentation.position(now); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| let sample = Sample { | ||
| at: ms(now.duration_since(self.start)), | ||
| render: observation.as_ref().map(|_| ms(totals.clock)), | ||
| timestamp: playhead.map(ms), | ||
| clock: clock.map(ms), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| stalled: observation.as_ref().map(|(o, _)| o.stalled), | ||
| delay: Some(ms(delay)), | ||
| output_latency: observation.as_ref().and_then(|(o, _)| o.latency).map(ms), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: moq-dev/moq
Length of output: 8572
Script executed:
Repository: moq-dev/moq
Length of output: 23039
Script executed:
Repository: moq-dev/moq
Length of output: 14304
Keep the clock position as a typed duration.
clockstores bare milliseconds, soSamplecannot enforce its unit. Store it asOption<Duration>and serialize it as floating-point milliseconds to preserve the metrics schema.As per coding guidelines, “Typed units only (
Duration,moq_net::Timestamp), neverf64seconds or bare millis.”Source: Coding guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declining:
Sampleis the serialization schema shared withtest/audio-quality, and every duration field in it (at,render,timestamp,delay, ...) is alreadyOption<f64>milliseconds converted byms()at construction. The typed value is theDurationfromposition(); convertingclockalone would make it the one inconsistent field.(Written by Opus 5.5 with medium)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rate Limit Exceeded
@kixelatedhave exceeded the limit for the number of chat messages per hour. Please wait 16 minutes and 6 seconds before sending another message.