3

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.

Aleksandar G
  • 1,163
  • 2
  • 20
  • 25
Mikael
  • 71
  • 1
  • 6
  • This is getting more weird. The logic for the onCompletionListener seems to behave correct, I have discovered that the buffering seems to be the issue. The onBufferingUpdateis getting called as expected but it will never reach to 100%. Instead it stops somewhere on 33-43%. I'm performing my tests on a WiFi network so the connection should not be the issue. Testing with Android M 6.0.0 works fine, this only occurs for 6.0.1. Quite annoying, has anybody a hint? – Mikael May 03 '16 at 06:36
  • Is this a programming question? – Simon Bosley May 03 '16 at 10:38
  • Yes it is, since I need to know if there are any workarounds that can make the buffering to work properly, eg. set some specific member or such. – Mikael May 03 '16 at 12:34
  • Where's the code then? – Laurel Jun 09 '16 at 20:44
  • any solution? I met same problem, the media player "saw EOS" too early. – Jiang YD Jul 18 '18 at 07:38
  • any one got the answer – Praveen Nov 07 '18 at 06:50

0 Answers0