Since I updated my phone, a Samsung S6, to Android 6.0.1, mediaPlayer have started to behave strange.
I use the MediaPlayer
to stream .mp3 audio over http and it has earlier worked without any problems.
Since this update almost all audio I stream which is longer than 1:30 will be stopped too early.
Example:
05-02 20:58:11.031 3119-26787/? V/MediaPlayerService: [1952] getDuration = 377496
05-02 20:58:11.031 15611-15611/com.test.test V/MediaPlayer-JNI: getDuration: 377496 (msec)
05-02 20:58:11.031 15611-15611/com.test.test V/MediaPlayer-JNI: getCurrentPosition: 119842 (msec)
05-02 20:58:11.041 15611-15611/com.test.test V/MediaPlayer-JNI: isPlaying: 1
05-02 20:58:11.041 15611-15611/com.test.test V/MediaPlayer-JNI: isPlaying: 1
05-02 20:58:11.061 3625-4927/? V/BroadcastQueue: [background] Process cur broadcast BroadcastRecord{d8b120b u0 null qIdx=4}, state= (APP_RECEIVE) DELIVERED for app ProcessRecord{436e057 16133:com.google.android.gms.persistent/u0a11}
05-02 20:58:11.151 3625-4936/? I/ActivityManager: Killing 16021:com.samsung.android.themecenter/1000 (adj 15): DHA:empty #31
05-02 20:58:11.171 3625-4951/? D/ActivityManager: isAutoRunBlockedApp:: com.samsung.android.themecenter, Auto Run ON
05-02 20:58:11.241 3119-16904/? I/NuPlayerDecoder: [audio] saw output EOS
05-02 20:58:11.241 3119-16903/? I/NuPlayerRenderer: onQueueEOS audio finalResult : -1011
05-02 20:58:11.371 3119-16903/? I/NuPlayerRenderer: [audio] notifyEOS() End of Stream, delayUs : 590370
05-02 20:58:11.371 3119-16903/? V/AudioSink: stop
05-02 20:58:11.681 3119-16896/? D/GenericSource: cachedDurationUs = 0.00 secs, eos=1
05-02 20:58:11.961 3119-16893/? I/NuPlayerRenderer: reachedAudioEOS (1)
05-02 20:58:11.961 3119-16893/? V/NuPlayer: reached audio EOS
As the log shows, a call to getDuration()
is made (377496 ms).
Directly after a call to getCurrentPosition()
is made (119842 ms).
After this NuPlayer
seems to detect an EOS and the OnCompletionListener
is performed and the audio is stopped.
Just before I updated to Android 6, this worked without any issues.
Does anybody have an idea what's going on and how this can be prevented?
Thanks in advance.