-
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
OkHttpDataSource: onTransferEnd called twice #1476
Comments
I'm confused by this statement. There's only one call to |
ok, further investigation shows indeed that closeConnectionQuietly does not call close of the same instance, but the fact remains that onTransferEnd is still called twice in the same instance. once when getBufferedPercentage returns 0 and another time where getBufferedPercentage>90 |
|
The issue is that onTransferEnd is called more than once from the same instance of exoplayer and the same DataSource. |
|
That's great. What's the logic in onTransferEnd anyway? |
Your assumption that playing a piece of media maps onto a single network request is incorrect. Some media playbacks will require many (typically bounded) network requests. Each one of them counts as a transfer. Hence this is working as intended. Depending on exactly what you're playing, it's either necessary to make two requests due to the nature of the media, or it's an inefficiency in ExoPlayer (note: it's not "broken" as such and neither is it doing anything that the player is not legitimately allowed to do; it's just not as efficient as it could be). The main cause of the latter is tracked by #1041. |
seems like listener.onTransferEnd is called twice on OkHttpDataSource
once in close() which later calls closeConnectionQuietly() which calls close() again.
The text was updated successfully, but these errors were encountered: