Skip to content
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

Change time.Sleep to time.Ticker in insertable streams example #2836

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Change time.Sleep to time.Ticker in insertable streams example #2836

merged 1 commit into from
Jul 29, 2024

Conversation

AfonsoVilalonga
Copy link
Contributor

Description

Hello,

While looking at the WebRTC examples, I came across the following comment in the "play-from-disk" example:

(line 196-198)

// It is important to use a time.Ticker instead of time.Sleep because
// * avoids accumulating skew, just calling time.Sleep didn't compensate for the time spent parsing the data
// * works around latency issues with Sleep (see https://github.com/golang/go/issues/44343)

However, the "insertable streams" example still uses time.Sleep. I changed the code of the example to use time.Ticker like the "play-from-disk" example.

Reference issue

Fixes #2835

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.87%. Comparing base (021c271) to head (632aa57).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2836      +/-   ##
==========================================
- Coverage   78.90%   78.87%   -0.03%     
==========================================
  Files          89       89              
  Lines        8314     8314              
==========================================
- Hits         6560     6558       -2     
- Misses       1277     1278       +1     
- Partials      477      478       +1     
Flag Coverage Δ
go 80.46% <ø> (-0.03%) ⬇️
wasm 64.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sean-Der
Copy link
Member

Works great @AfonsoVilalonga

Thank you so much! If you are interested I hope you stay involved with the project, always looking for more contributors :)

@Sean-Der Sean-Der merged commit 35b3ae1 into pion:master Jul 29, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency in some of the examples
2 participants