android-openslmediaplayer: Playback stops after changing several tracks (data sources) in HybridMediaPlayerFactory only..

Hello h6ah4i first of all amazing mediaplayer library, I just found one glitch while using HybridMediaPlayerFactory when my app changes tracks, after 10-15 changes it suddenly stops playback with no error or warning in logcat too 😦 This is my code for changing tracks:

GlobalApp.mediaPlayer.reset();
GlobalApp.mediaPlayer.setDataSource(context, Uri.parse("file://mysong"));
 GlobalApp.mediaPlayer.setOnPreparedListener(new IBasicMediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(IBasicMediaPlayer mp) {
GlobalApp.mediaPlayer.start();
}});
GlobalApp.mediaPlayer.prepareAsync();

Above code working fine in case of OpenSLMediaPlayerFactory… Please Suggest if I am doing something wrong…!!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

UPDATE I’ve just reproduced the bug on my Nexus 5X!

Also, I tweaked the sample app to automate the testing

@h6ah4i Hiii I have created sample project for you on github. Take a look here https://github.com/hunnydarapstar/sample-openslmediaplayer-buggy To reproduce the bug, you have to carefully change 20-25 tracks (make sure you are testing on device having more than 30 tracks), after sometime while you forward a track, playback will stop and you can start your investigation. If you need any help regarding reproducing the bug, Feel free to ask. Thanks 😃

@hunnydarapstar Hi. Thank you for the issue report.

I am checking the implementation around using the AudioTrack class in native layer, but I do not see any implementation bugs there. Could you give me more info to investigate it?

  • Library version
  • Android OS version
  • Device / Model
  • Dump of adb shell dumpsys media.audio_flinger (while playing audio using HybridMediaPlayer)
  • Sample project and data to reproduce the bug

Thanks.