You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
State updates from Player.EventListener.onPlayerStateChanged() may be inconsistent between multiple listeners added with Player.addListener(). This happens when one of the listeners callbacks changes the Player state.
For example, if a listener call Player.stop() when receiving a Player.STATE_ENDED state update, all succeeding listeners will receive a Player.STATE_IDLE state update.
The Expected behaviour is that all listeners receive the same state update values.
Reproduction steps
Apply this patch to the main demo app in order to add two new Player.EventListener:
Play any video from the main demo app. The following logcat snippet is from full play of "YouTube DASH -> Google Play (WebM, VP9)":
When the player state is changed from an event listener callback, we may
get recursive listener notifications. These recursions can produce a wrong
order, skip or duplicate updates, and send different notifications to
different listeners.
This change serializes listener notifications by clustering all update data
in a helper data class and adding the updates to a queue which can be handled
in a loop on the outer layer of the recursion.
As playWhenReady updates also reference the current playbackInfo, we need to
redirect the listener notifcations for setPlayWhenReady to the same queue.
Issue:#4276
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198031431
When the player state is changed from an event listener callback, we may
get recursive listener notifications. These recursions can produce a wrong
order, skip or duplicate updates, and send different notifications to
different listeners.
This change serializes listener notifications by clustering all update data
in a helper data class and adding the updates to a queue which can be handled
in a loop on the outer layer of the recursion.
As playWhenReady updates also reference the current playbackInfo, we need to
redirect the listener notifcations for setPlayWhenReady to the same queue.
Issue:#4276
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198031431
Issue description
State updates from
Player.EventListener.onPlayerStateChanged()
may be inconsistent between multiple listeners added withPlayer.addListener()
. This happens when one of the listeners callbacks changes thePlayer
state.For example, if a listener call
Player.stop()
when receiving aPlayer.STATE_ENDED
state update, all succeeding listeners will receive aPlayer.STATE_IDLE
state update.The Expected behaviour is that all listeners receive the same state update values.
Reproduction steps
Player.EventListener
:The issue is on the latest 4 state updates. Note that
PlayerLogEventListener
never receives thePlayer.STATE_ENDED
state upate:Link to test content
Can be reproduced with all medias from main demo app.
Version of ExoPlayer being used
r2.8.0
Device(s) and version(s) of Android being used
Reproduced on Galaxy S7 and Motorola G5, both running Android 7.0 (API 24), and on Emulator running Android 8.1.0 (API 27).
A full bug report captured from the device
bugreport-sdk_gphone_x86-OSM1.180201.007-2018-05-21-01-54-13.zip
The text was updated successfully, but these errors were encountered: