libgdx/gdx-video

Race condition in VideoPlayerAndroid

anonl opened this issue · 1 comments

anonl commented

MediaPlayer initialization is performed on the main looper thread, but not all accesses to 'player' are correctly synchronized:

  • stop()
  • dispose()
  • isPlaying()
  • setVolume()

In addition, the done/prepared flag should be made volatile since they're also written to from the looper thread.

Why is the initialization of the MediaPlayer done on the main looper anyway? Can't you use the current thread's looper (or create it if one doesn't exist yet)?

I'll look into this issue next weekend because of time issues. I hope that's ok for you ;)