-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Hi,
I have a question related to "release" method of MediaPlayer and Player class.
- In MediaPlayer class, when we call release() we will release Player and set this value to null (mPlayer = null).
- In Player class we will send message "MSG_STOP" to EventHandler stop other threads,
But EventHandle will handle "MSG_STOP" in another thread, so have a case a command "mPlayer = null" is run while we are processing "MSG_STOP". When "mPlayer = null" is set I think app will be crashed, because we are referencing to mPlayer in EventHandle.
Could you give your advice about this situation? Or I have misunderstood anything?
In the case it has problem, could I use "sendMessageAndAwaitResponse(nMsg)" instead of "mEventHandler.sendMessageAtFrontOfQueue(nMsg)" in release method of Player?
Thanks,
Metadata
Metadata
Assignees
Labels
No labels