TheRealFalcon / Prestissimo

Drop-in replacement for the Presto service on Android
57 stars 10 forks source link

play back ANR? #18

Open liufsd opened 10 years ago

liufsd commented 10 years ago

Hi.man! when i just back to my homeActivity from the player activity .it will ANR often . so i try to disable the SoundService in my manifest config,it will back success,and never ANR,I guess your SoundService maybe have some problem . for Example synchronized error ,i mean lock bad. and i found that your SoundService need add like this if (track != null) {//do your code..},well,it's safe project. Thanks.

TheRealFalcon commented 10 years ago

Did you find an error in a specific section of code? A null pointer should result in a crash, not an ANR. Is your problem specific to AntennaPod? If so, I'm thinking it more has to do with what gets executed when the callback to the player is called.

liufsd commented 10 years ago

ok .i only use the presto_client-0.8.5.jar. I have not use the AntennaPod. and i use the media's interface such as " mMediaPlayer.setOnPreparedListener(new com.aocate.media.MediaPlayer.OnPreparedListener() {" .. mMediaPlayer.setOnBufferingUpdateListener(new com.aocate.media.MediaPlayer.OnBufferingUpdateListener() . when i back to homeActivity. on my MediaPlayerActivity's onDestroy ,this's my code: if (observer != null) { observer.stop(); } if (mMediaPlayer != null) { mMediaPlayer.stop(); mMediaPlayer.reset(); mMediaPlayer.release(); currentRange = ""; nm.cancel(1); if (mediaPlaybackTimer != null) { mediaPlaybackTimer.cancel(); } mMediaPlayer = null; }

so, what's wrong??? i just use this library like android system media player control. i guess when i release the media your library not on stop at this time ,such as stop slow or another . Thanks.

liufsd commented 10 years ago

And , i have test that if not use your library (your SoundService). ANR not appear ,so i have guess my last answers.and often tell me this log: 02-28 10:37:34.697 24936-24936/com.eusoft.ting.en E/ActivityThread﹕ Activity com.eusoft.ting.ui.ReaderActivity has leaked ServiceConnection com.aocate.media.ServiceBackedMediaPlayer$1@42ccf1d0 that was originally bound here android.app.ServiceConnectionLeaked: Activity com.eusoft.ting.ui.ReaderActivity has leaked ServiceConnection com.aocate.media.ServiceBackedMediaPlayer$1@42ccf1d0 that was originally bound here at android.app.LoadedApk$ServiceDispatcher.(LoadedApk.java:979) at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:873) at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1561) at android.app.ContextImpl.bindService(ContextImpl.java:1544) at android.content.ContextWrapper.bindService(ContextWrapper.java:517) at com.aocate.media.ServiceBackedMediaPlayer.ConnectPlayMediaService(ServiceBackedMediaPlayer.java:142) at com.aocate.media.ServiceBackedMediaPlayer.(ServiceBackedMediaPlayer.java:129) at com.aocate.media.MediaPlayer.setupMpi(MediaPlayer.java:340) at com.aocate.media.MediaPlayer.(MediaPlayer.java:295) at com.aocate.media.MediaPlayer.(MediaPlayer.java:279) at com.eusoft.ting.util.playback.AudioPlayer.(AudioPlayer.java:13) at com.eusoft.ting.ui.ReaderActivity.prepareLoadAudio(ReaderActivity.java:1488) at com.eusoft.ting.ui.ReaderActivity.access$3600(ReaderActivity.java:63) at com.eusoft.ting.ui.ReaderActivity$10.onPageFinished(ReaderActivity.java:632) at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:449) at com.android.org.chromium.android_webview.AwContentsClient$AwWebContentsObserver$1.run(AwContentsClient.java:73) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

I mean some problems between the presto's custom mediaPlayer and your SoundService. how to fix it ??? Thanks.