Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion quest/m0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ repository.
- [moq-video's browser backends are pinned](/quest/m0/pin-browser-video.md) - the web studio's video slice and browser composition
- [moq-audio's browser backends are pinned](/quest/m0/pin-browser-audio.md) - the web studio's audio slice
- [moq-audio's source tap is pinned](/quest/m0/pin-audio-tap.md) - the samples clap-to-measure sync times a clap from
- [A replayed media file never repeats a timestamp](/quest/m0/media-replay-timestamps.md) - a media source that starts over publishes strictly increasing timestamps, and its flaky test passes every run

## Related

Expand Down
25 changes: 0 additions & 25 deletions quest/m0/media-replay-timestamps.md

This file was deleted.

12 changes: 11 additions & 1 deletion rs/moq-scene/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,13 @@ impl Driver {
if let (Some(frame), Some((_, config))) = (&picture, &video) {
self.open(own, frame, config).await;
}
let begin = begin.unwrap_or_else(|| kio::clock::now() + BUS_LATENCY);
// A cut's play begins after the last picture already published, even
// one cut off before it showed, so the track's time never repeats.
let begin = begin.unwrap_or_else(|| {
let soonest = kio::clock::now() + BUS_LATENCY;
own.stamped
.map_or(soonest, |stamped| soonest.max(stamped + Duration::from_millis(1)))
});
self.ran(play, |run| {
run.begun.get_or_insert(begin);
});
Expand Down Expand Up @@ -1796,6 +1802,7 @@ impl Driver {
) -> Result<(), Error> {
self.open(own, frame, config).await;
if let Some(video) = &mut own.track {
own.stamped = Some(shows);
let stamp = shows.saturating_duration_since(own.origin);
frame.timestamp =
moq_net::Timestamp::from_micros(stamp.as_micros() as u64).map_err(moq_video::Error::from)?;
Expand Down Expand Up @@ -1863,6 +1870,8 @@ struct Own<'a, 'b> {
/// Whether the track was opened, or failed to, so it is tried once.
opened: bool,
origin: Instant,
/// When the last picture encoded onto the track shows.
stamped: Option<Instant>,
}

impl<'a, 'b> Own<'a, 'b> {
Expand All @@ -1872,6 +1881,7 @@ impl<'a, 'b> Own<'a, 'b> {
track: None,
opened: false,
origin,
stamped: None,
}
}
}
Expand Down