Prevent wrong value from getTotalBufferedDurationUs#7449
Prevent wrong value from getTotalBufferedDurationUs#7449fgl27 wants to merge 1 commit intogoogle:dev-v2from
Conversation
prevent negative value for rendererPositionUs, in random cases for a split second the value of rendererPositionUs is negative after a seekto or starting a playback with a ResumePosition >>> 0 for example, what results on a wrong and too big value be returned Signed-off-by: fgl27 <fglfgl27@gmail.com>
|
@tonihei @marcbaechinger Please could you take a look? |
|
The rendererPosition shouldn't be negative really. If you can reproduce the problem, can you open a new GitHub issue instead with reproduction steps? It feels we should fix the underlying issue instead of working around it. I'll close this PR for now assuming we won't need it, but feel free to reopen. |
|
You guys now about the issue so fell free to fix the way you like I will not open a issue as I already fix on my side, and yes is better to fix where this start but I don't know where it is, I fix here because is simple and works, I have very limit time to work on my projects, so you guys fix this the way you prefere. I log the values from the function and start to seekto after a few tries I get the issue. Log it individual During the test I notice that when the problem happens was because I only notice it because I added a progress bar that shows the buffered size in the progress bar, after a seekto or when the app resumes I notice that the buffer part was too big. That red part on the bar next to the circle is the buffer, it also show on top right corner in seconds, but I really notice on the bar. |
|
I can't reproduce that (even with logging). Note that there is an edge case in which the renderer may report a position that is slightly more than the buffered position. We have a guard against that (5 lines further down from your change) that effectively prevents any buffered position to become negative. If you see this happening again and you think there is a bug, please file an issue with reproduction steps because there is nothing I can do without knowing further details. |
|
I can seeking on a hls vod, did a seek 4, 5 times and one did result in negative. |
|
Thanks. I was now able to see it too on the HLS TS media playlist in our demo app. Looks like something is going wrong with the audio timestamp tracking. @andrewlewis Could you have a look if that's an issue we should look into or provide a workaround?
|
|
@andrewlewis - I can take a look at this if you like. |
|
I'll moved it to a new issue because this one is a closed PR (see #7456). |

prevent negative value for rendererPositionUs, in random cases
for a split second the value of rendererPositionUs is negative
after a seekto or starting a playback with a ResumePosition >>> 0
for example, what results on a wrong and too big value be returned
Signed-off-by: fgl27 fglfgl27@gmail.com