-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Optional offset param to IVideoSource.selectVideoTrack for partial buffer clear #144
Optional offset param to IVideoSource.selectVideoTrack for partial buffer clear #144
Conversation
@@ -61,9 +61,12 @@ shaka.media.IStream.prototype.hasEnded = function() {}; | |||
* when the stream starts for the first time. | |||
* @param {boolean} clearBuffer If true, removes the previous stream's content | |||
* before switching to the new stream. | |||
* @param {number=} opt_clearBufferOffset if |clearBuffer| and |opt_clearBufferOffset| |
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.
80 char limit.
7a00a18
to
5433bbd
Compare
Hi @tdrews, I've updated the branch with the suggested changes (have squashed the commits, not sure if you prefer that or not?), with the exception of removing the @expose annotations. Reason being is that without it, the compiler is renaming both the selectVideoTrack function and the videoSource variable (which is now just a protected member), which breaks an external custom ABR manager. Is there a better way to stop the compiler from renaming? |
Ah, yes, you are right about Does your custom ABR manager only need to access |
5433bbd
to
2c35aae
Compare
Yes the only reason to expose videoSource was to call videoSource.selectVideoTrack with different parameters. No worries about the change, I've updated the PR so that videoSource remains private and SimpleAbrManager.selectVideoTrack has the exta parameter for the offset. |
Testing in progress... |
CI error: Failed to parse log file! |
:( Our bot is having a bad day. Code looks good, but there are some linter errors. Can you check with build/lint.sh ? |
The linter is returning some additional errors compared to the latest master branch (all "Missing space before.." or "Wrong indentation: expected any of.." errors) - should there be zero errors? I wasn't sure if this was a requirement as master also has these (about 200 errors). Unless me running this on Windows via Cygwin is giving different results? Here is a gist of the the linter log for this branch: https://gist.github.com/jonoward/a49b613c9ac5c988779c |
Hmm, that's strange. There should be 0 linter errors on master. Perhaps this is an issue with running the linter on Cygwin as you suggested; I'll add an issue to track this. The only linter errors I see are indentation ones,
|
Yeah this is a weird one, if I clone a fresh copy of master, with no modifications, and run the linter I get a bunch of errors, nearly all of them are the [Missing space before "("] error, e.g. lines like this: Is it possible that the lint rulesets are slightly different on Cygwin? Because for me it seems that nearly all the usages of Promise.catch are failing this test, when I'm not sure if they should (seems it should only apply for actual catch blocks). I'll try to tweak this PR branch so that it at least fails the linter in the same way that master does. I could run the automated fixjsstyle command, but I'm not sure if you actual intended for these Promise.catch calls to have the extra spaces. I'll try rustle up a linux VM to see if I get different results there. Thanks for the help.. |
…ows a partial clearing of the buffer to occur
2c35aae
to
d5d43c6
Compare
Right, have pushed some new formatting changes such that the linter is reporting no errors when run on Linux - could you try run the bot again? Thanks |
Testing in progress... |
All tests passed! |
…itch Optional offset param to IVideoSource.selectVideoTrack for partial buffer clear
By default, the linter produces a "beep" character (ASCII 7) on failure. This caused an extra character to appear in the buildbot's log on the beginning of a line that should have served as a delimiter to make parsing easier. The beep therefore caused a parse failure in the buildbot when it was proofing pull-requests with linter errors. (For an example of this failure, see PR #144.) The solution is the linter's --nobeep flag. Change-Id: I1a0ea7529134f9556a849fd0dd6ccb70832e6a38
Mainly for use in a custom ABR manager, where calling StreamVideoSource.selectVideoTrack could pass an optional offset param, which is the number of seconds in front of video.currentTime that the buffer should be cleared from.
Useful when configuring the player with a large buffer that should be truncated when upgrading from a lower bitrate to a higher one (so that the user sees the newer bitrate without having to player through the size of the buffer)
Addresses issue #95