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
- Fix warning message due to inappropriate use of AudioTrack.write() (part of the issue #26) Warning message: > E/android.media.AudioTrack: AudioTrack.write() called with invalid size (38400) value NO... — committed to h6ah4i/android-openslmediaplayer by h6ah4i 7 years ago
- Add workarond for incomplete AudioTrack.write() (fix issue #26) — committed to h6ah4i/android-openslmediaplayer by h6ah4i 7 years ago
- Add workaround for incomplete AudioTrack.write() (fix issue #26) — committed to h6ah4i/android-openslmediaplayer by h6ah4i 7 years ago
- Merge pull request #29 from h6ah4i/fix_issue_26 Add workaround for incomplete AudioTrack.write() (fix issue #26) — committed to h6ah4i/android-openslmediaplayer by h6ah4i 7 years ago
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
AudioTrackclass in native layer, but I do not see any implementation bugs there. Could you give me more info to investigate it?adb shell dumpsys media.audio_flinger(while playing audio using HybridMediaPlayer)Thanks.