-
Notifications
You must be signed in to change notification settings - Fork 6k
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
player.getCurrentPosition() return value is negative when using ClippingMediaSource #4873
Comments
@ojw28 Did you already had the time to look into this issue? Is there anything I can do to support you? |
Reproducible on the latest development branch. |
Thanks for reporting. We'll provide a fix for this soon. |
…o offset. If we prepare a deferred media period before the actual timeline is available, we either prepare with position zero (= the default) or with a non-zero initial seek position. So far, the zero (default) position got replaced by the actual default position (including any potential non-zero window offset) when the timeline became known. However, a non-zero initial seek position was not corrected by the non-zero window offset. This is fixed by this change. Related to that, we always assumed that the deferred media period will the first period in the actual timeline. This is not true if we prepare with an offset (either because of an initial seek position or because of a default window position). So, we also determine the actual first period when the timeline becomes known. Issue:#4873 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=215213030
The commit above fixes the issue. |
@tonihei thanks! Hope to give me some information about how was this bug generated? |
@ojw28 I find that when the player plays the first clip video ,press home button, then resume to play,there is no this bug. Hope you give me some explanation. |
The bug occurred because the player creates the element at which playback starts with a default position of zero until we know more. In your case, this default position was non-zero (because of the clipping) and we forgot to set the right offset at one point. Not sure why you don't see the bug with the first video? I was able to reproduce the issue with the first and the second video in a concatenation. |
…o offset. If we prepare a deferred media period before the actual timeline is available, we either prepare with position zero (= the default) or with a non-zero initial seek position. So far, the zero (default) position got replaced by the actual default position (including any potential non-zero window offset) when the timeline became known. However, a non-zero initial seek position was not corrected by the non-zero window offset. This is fixed by this change. Related to that, we always assumed that the deferred media period will the first period in the actual timeline. This is not true if we prepare with an offset (either because of an initial seek position or because of a default window position). So, we also determine the actual first period when the timeline becomes known. Issue:#4873 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=215213030
ExoPlayer version: v2.8.4
The sample code is :
I use a ClippingMediaSource to split one video into two video at point 15s, then concatenate them.
When the player begins to play the second video, I pressed home button, then resume to play, I find
that the TimeBar's current position is negative. The logs like this:
The text was updated successfully, but these errors were encountered: