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

Looping and concatenation with uneven track end times can cause stuck buffering state. #1874

Closed
ojw28 opened this issue Sep 29, 2016 · 11 comments
Labels

Comments

@ojw28
Copy link
Contributor

ojw28 commented Sep 29, 2016

As per title, playback of a playlist can get stuck in the buffering state if the end times of the tracks of the sample coming to an end are uneven.

@mopsalarm
Copy link

I ran into (maybe) this bug myself today with this video: http://vid.pr0gramm.com/2017/01/21/8da9138fe27c1b97.mp4

ffmpeg tells me, that the audio ends at 19.45s, video already at 18.92. With the end of the video stream, exo player freezes and wont play the last half second of audio content. I could track it down to a blocking call in ConditionVariable.block() in ExtractorMediaPeriod.load(). Maybe this helps!

@zijing07
Copy link

zijing07 commented Jul 4, 2017

Well I tried the workaround @ojw28 mentioned in #1846 , it does not help though.

When the player is about to reach the end, playbackstate changes to buffering and the player freezes. video link

@ojw28
Copy link
Contributor Author

ojw28 commented Jul 4, 2017

@zijing07 - There was some confusing posting of similar-but-unrelated issues onto the bottom of some of the issues that reference this one, which I've now removed for clarify. As an aside, the reason we've started automatically locking old issues is to help prevent this kind of confusion.

If you have the issue being tracked here, where the end times of the audio and video tracks are uneven in the media being played, then you need to follow this issue and wait for a fix.

@tonihei tonihei changed the title Ragged track end times can cause stuck buffering state in playlist Looping and concatenation with uneven track end times can cause stuck buffering state. Sep 6, 2017
@guness
Copy link

guness commented Sep 6, 2017

Just checked several examples; on most of the media, audio and video durations do no match exactly.
Actually, they are always different by at most half a second.

As a result, most of the videos loop nice for a long time, but some of those hit this issue.

@crossle
Copy link

crossle commented Sep 27, 2017

same problem, i just replace setRepleatMode use seekTo(0) when buffer end.

ojw28 added a commit that referenced this issue Oct 3, 2017
This avoids spurious position reports following an underrun.

Github: #1874

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170344399
ojw28 added a commit that referenced this issue Oct 3, 2017
* Always assume a renderer is ready if it's read to the end of
  its current stream and there's a subsequent period already
  prepared. This prevents getting stuck when a non-clock renderer
  has a short stream.
* Switch to the standalone clock if the renderer providing the
  media clock has read to the end of its current stream, is no
  longer ready, and there's a subsequent period already prepared.
  This prevents getting stuck when a clock renderer has a short
  stream.
* Remove unnecessary clock synchronization logic (since it would
  need to be made more complicated as a result of this change).
* Don't update the playing period holder when playWhenReady is
  false. This avoids the position jumping to the start of the
  next period when seeking to the very end of the current period
  whilst paused (we still end up showing the first frame of video
  from the next period, but fixing that will have to wait).

Github: #1874

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170717481
@ojw28
Copy link
Contributor Author

ojw28 commented Oct 3, 2017

This should now be fixed in dev-v2. Please give it a try. If you have media files that still reproduce the problem, please attach them here or send them to [email protected]. Thanks!

@guness
Copy link

guness commented Oct 7, 2017

one problematical video I have is playing nice on dev-v2 branch. will update if I face another media that reproduces this.

@Aqua-Ye
Copy link

Aqua-Ye commented Nov 22, 2017

Hi, any idea when you plan to release this fix? Thanks.

@ojw28
Copy link
Contributor Author

ojw28 commented Nov 22, 2017

It's fixed in 2.6.0, which is scheduled to be released this week.

@Aqua-Ye
Copy link

Aqua-Ye commented Nov 22, 2017

Cool thanks!

@zijing07
Copy link

zijing07 commented Jan 4, 2018

Wow! That's really good news! Thanks very much!

@google google locked and limited conversation to collaborators Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants