Skip to content

Commit

Permalink
worker: fix playlist unchanged on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
2bc4 committed Feb 11, 2024
1 parent 7157278 commit 01c6fc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/hls/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl Handler {
match self.playlist.segments() {
SegmentRange::Partial(segments) => {
for segment in segments {
debug!("Sending segment to worker:\n{:?}", segment);
debug!("Sending segment to worker:\n{segment:?}");
match segment {
Segment::Normal(_, url)
| Segment::NextPrefetch(url)
Expand All @@ -128,7 +128,10 @@ impl Handler {
}
self.init = false;

match newest.context("Failed to find newest segment")? {
let newest = newest.context("Failed to find newest segment")?;
debug!("Sending newest segment to worker:\n{newest:?}");

match newest {
Segment::Normal(duration, url) => {
self.worker.url(url.clone())?;
duration.sleep(time.elapsed());
Expand Down
2 changes: 1 addition & 1 deletion src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Worker {
}

pub fn sync_url(&mut self, url: Arc<Url>) -> Result<()> {
self.send(url, false)
self.send(url, true)
}

pub fn url(&mut self, url: Arc<Url>) -> Result<()> {
Expand Down

0 comments on commit 01c6fc4

Please sign in to comment.