1. Nimm jetzt an unserem Uhans - 3. ADVENT - Gewinnspiel teil - Alle Informationen findest Du hier!

Mediaplayer spielt nach laden einer MapActivity nur noch 1 sekunde lang.

Dieses Thema im Forum "Android Spiele Entwicklung" wurde erstellt von Quarki, 23.04.2012.

  1. Quarki, 23.04.2012 #1
    Quarki

    Quarki Threadstarter Neuer Benutzer

    Beiträge:
    7
    Erhaltene Danke:
    0
    Registriert seit:
    07.12.2011
    Hallo Leute.

    Ich möchte in meiner Anwendung Sounds abspielen.
    Das ganze Funktioniert soweit auch erstmal alles wie es soll, der Sound wird zum passenden Zeitpunkt komplett abgespielt.
    Wenn ich von der Activity, wo das passiert in eine andere Activity und wieder zurück wechsle, funktioniert es auch weiterhin wie gewollt und es findet jeweils zum Schluss das OnComplete Ereignis statt.

    Jedoch habe ich neben den normalen Activitys auch eine MapActivity. Wechsel ich von der normalen Activity in die MapActivity und dann wieder zurück, startet das Abspielen des Sounds zwar, jedoch bricht es nach ~1 Sekunde ab, ohne dass OnComplete, OnInfo oder OnError statt finden. :scared:
    Aktuell spiel ich den Sound, der als .mp3 Datei vorliegt, so ab:
    Code:
                MediaPlayer mp = MediaPlayer.create(ctx, R.raw.bomb);
    
                    mp.setOnCompletionListener(new OnCompletionListener(){
    
                        @Override
                        public void onCompletion(MediaPlayer arg0) {
                            Log.w("m.p.Media", "Mediaplayer, onCompletion");
                            arg0.release();
                        }
    
                    });        
    
                    mp.setOnInfoListener(new OnInfoListener(){
                        @Override
                        public boolean onInfo(MediaPlayer mp, int what, int extra) {
                            Log.w("m.p.Media", "what: " + what + " extra: " + extra);
                            return false;
                        }
                    });
                    mp.setOnErrorListener(new OnErrorListener(){
                        @Override
                        public boolean onError(MediaPlayer arg0, int arg1, int arg2) {
                            Log.w("m.p.Media", "MediaPlayer-Error: arg1: " + arg1 + " arg2: " + arg2);
                            return false;
                        }
                    });
    
    
                    mp.setOnPreparedListener(new OnPreparedListener(){
    
                        @Override
                        public void onPrepared(MediaPlayer arg0) {
                            arg0.start();
                        }
    
                    });    
    dass der .start() Aufruf im OnPreparedListener ist, ist ein (Erfolgloser) versuch das Problem zu lösen. Es besteht auch, wenn ich den Mediaplayer außerhalb dieses Listeners starte.

    zwischen den Activitys wechsel ich so hin und her:
    Code:
        Intent intent = new Intent(this, jeweiligeActivity.class);
        startActivity(intent);
        overridePendingTransition(R.anim.fade_in, R.anim.fade_out);  
    
    Hat jemand eine Idee, woran das liegen könnte?
     
  2. DieGoldeneMitte, 23.04.2012 #2
    DieGoldeneMitte

    DieGoldeneMitte Android-Lexikon

    Beiträge:
    1,230
    Erhaltene Danke:
    256
    Registriert seit:
    05.02.2010
    Phone:
    Nexus 5X
    Tablet:
    Nexus 7 (2013)
    Könnte es sein, dass das System den mp3 Prozess terminiert, weil der Speicher knapp wird? Müsste man dann im Catlog sehen können.
     
  3. Quarki, 24.04.2012 #3
    Quarki

    Quarki Threadstarter Neuer Benutzer

    Beiträge:
    7
    Erhaltene Danke:
    0
    Registriert seit:
    07.12.2011
    hmm.... vll hätte man mal vorher in das Allgemeine Log geschaut und nicht nur in das Session Log....

    die Stelle ab der es anfängt sich zu Unterscheiden, ist rot hervorgehoben...
    Logcat von einem funktionierendem Aufruf:
    Code:
    04-24 09:34:21.340: W/m.p.Media(4942): create MediaPlayer
    04-24 09:34:21.340: D/AwesomePlayer(241): setDefault
    04-24 09:34:21.340: E/AwesomePlayer(241): calling AwesomePlayer
    04-24 09:34:21.340: D/AwesomePlayer(241): setDefault
    04-24 09:34:21.340: E/AwesomePlayer(241): calling reset
    04-24 09:34:21.340: D/AwesomePlayer(241): reset_l
    04-24 09:34:21.340: I/AwesomePlayer(241): cancel player events
    04-24 09:34:21.340: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:34:21.340: D/AwesomePlayer(241): reset done
    04-24 09:34:21.340: D/AwesomePlayer(241): setListener
    04-24 09:34:21.340: D/AwesomePlayer(241): setAudioSink
    04-24 09:34:21.340: D/AwesomePlayer(241): setDataSource
    04-24 09:34:21.340: D/AwesomePlayer(241): reset_l
    04-24 09:34:21.340: I/AwesomePlayer(241): cancel player events
    04-24 09:34:21.340: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:34:21.340: D/FileSource(241): FileSource::FileSource(fd)
    04-24 09:34:21.340: D/AwesomePlayer(241): setDataSource_l
    04-24 09:34:21.340: E/MediaExtractor(241): **********MediaExtractor::Create
    04-24 09:34:21.340: D/DivXPlugin(240): DivXPlugin::onInitialize : 90
    04-24 09:34:21.340: D/DivXPlugin(240): DivXPlugin::onSetOnInfoListener : 90
    04-24 09:34:21.340: D/FileSource(241): FileSource::DrmInitialization(DrmManagerClient* client)::Decrypt handle in NULL creating new DecryptHandle
    04-24 09:34:21.340: D/DivXPlugin(240): DivXPlugin::onTerminate : 90
    04-24 09:34:21.350: E/MediaExtractor(241): ************Autodetected media content as 'audio/mpeg' with confidence 0.20
    04-24 09:34:21.350: I/(241): Found XING header.
    04-24 09:34:21.350: D/AwesomePlayer(241): setDataSource_l
    04-24 09:34:21.350: D/AwesomePlayer(241): setAudioSource
    04-24 09:34:21.350: I/MediaPlayer(4942): prepareAsync called in state 4
    04-24 09:34:21.350: D/AwesomePlayer(241): prepareAsync
    04-24 09:34:21.350: D/AwesomePlayer(241): prepareAsync_l
    04-24 09:34:21.350: D/AwesomePlayer(241): onPrepareAsyncEvent
    04-24 09:34:21.350: D/AwesomePlayer(241): initAudioDecoder
    04-24 09:34:21.350: I/AwesomePlayer(241): Audio duration : 3239183
    04-24 09:34:21.350: D/AwesomePlayer(241): finishAsyncPrepare_l
    04-24 09:34:21.350: D/AwesomePlayer(241): notifyListener_l
    04-24 09:34:21.350: D/AwesomePlayer(241): notifyListener_l
    04-24 09:34:21.350: D/AwesomePlayer(241): setLooping
    04-24 09:34:21.350: D/AwesomePlayer(241): setLooping (0)
    04-24 09:34:21.390: W/m.p.Media(4942): onPrepared()
    04-24 09:34:21.390: D/AwesomePlayer(241): setLooping
    04-24 09:34:21.390: D/AwesomePlayer(241): setLooping (0)
    04-24 09:34:21.390: D/AwesomePlayer(241): setLooping
    04-24 09:34:21.390: D/AwesomePlayer(241): setLooping (0)
    04-24 09:34:21.390: E/AwesomePlayer(241): calling play
    04-24 09:34:21.390: D/AwesomePlayer(241): play
    04-24 09:34:21.390: E/AwesomePlayer(241): calling play_l
    04-24 09:34:21.390: I/AwesomePlayer(241): Not a drm file dude!!!
    04-24 09:34:21.390: D/AwesomePlayer(241): seekAudioIfNecessary_l
    04-24 09:34:21.390: D/AwesomePlayer(241): startAudioPlayer_l  mFlags = 0x15
    04-24 09:34:21.390: D/AudioPlayer(241): android::status_t android::AudioPlayer::start(bool) sourceAlreadyStarted=1 mStarted=0
    04-24 09:34:21.390: D/AudioPlayer(241): mFirstBufferResult =0
    04-24 09:34:21.390: D/AudioPlayer(241): mime =audio/raw
    04-24 09:34:21.390: D/AudioPlayer(241): mAudioSink->open , mSampleRate=44100
    04-24 09:34:21.390: V/AudioPolicyManager(241): startOutput() output 1, stream 3, session 82 mPhoneState 0
    04-24 09:34:21.390: V/AudioPolicyManager(241): startOutput() mLastrefcount 0
    04-24 09:34:21.390: V/AudioPolicyManager(241): getDeviceForStrategy() from cache strategy 0, device 8
    04-24 09:34:21.390: V/AudioPolicyManager(241): getNewDevice() selected device 8
    04-24 09:34:21.390: V/AudioPolicyManager(241): setOutputDevice() output 1 device 8 delayMs 0
    04-24 09:34:21.390: V/AudioPolicyManager(241): setOutputDevice() setting same device 8 or null device for output 1
    04-24 09:34:21.390: I/AudioFlinger(241): start output streamType (0, 3) for 1
    04-24 09:34:21.390: D/AudioHardware(241): AudioStreamOutALSA::setParameters() start_output_streamtype=3
    04-24 09:34:21.390: D/AwesomePlayer(241): addBatteryData
    04-24 09:34:21.400: D/AudioHardware(241): AudioHardware pcm playback is exiting standby.
    04-24 09:34:21.400: V/AudioHardware(241): open pcm_out driver
    04-24 09:34:21.400: I/AudioHardware(241): openPcmOut_l() mPcmOpenCnt: 0
    04-24 09:34:21.400: V/alsa_pcm(241): pcm_open(0x00027000)
    04-24 09:34:21.400: V/alsa_pcm(241): pcm_open() period sz multiplier 8
    04-24 09:34:21.400: V/alsa_pcm(241): pcm_open() period cnt 4
    04-24 09:34:21.460: V/alsa_pcm(241): pcm_open() period_cnt 4 period_sz 1024 channels 2
    04-24 09:34:21.460: V/alsa_pcm(241): pcm_open end
    04-24 09:34:21.460: V/AudioHardware(241): openPcmOut_l end
    04-24 09:34:21.460: V/AudioHardware(241): openMixer_l() mMixerOpenCnt: 0
    04-24 09:34:21.460: V/alsa_mixer(241): mixer_open
    04-24 09:34:21.460: V/alsa_mixer(241): mixer_open end
    04-24 09:34:21.460: V/AudioHardware(241): openMixer_l end
    04-24 09:34:21.460: V/AudioHardware(241): open playback normal
    04-24 09:34:21.460: V/AudioHardware(241): write() wakeup setting route HP_NO_MIC
    04-24 09:34:21.460: V/alsa_mixer(241): mixer_ctl_select HP_NO_MIC
    04-24 09:34:21.510: I/AudioHardware(241): mSetVolumeIndex=0, mIsMusicPlaying=1, musicvolumeindex=7
    04-24 09:34:21.510: V/AudioHardware(241): openMixer_l() mMixerOpenCnt: 1
    04-24 09:34:21.510: V/AudioHardware(241): openMixer_l end
    04-24 09:34:21.510: V/AudioHardware(241): setMusicVolumeIndex Headset Volume Control
    04-24 09:34:21.510: V/alsa_mixer(241): mixer_ctl_select 7
    04-24 09:34:21.510: V/AudioHardware(241): closeMixer_l() mMixerOpenCnt: 2
    04-24 09:34:21.510: V/AudioHardware(241): closeMixer_l mMixerOpenCnt = 1 end
    04-24 09:34:21.510: W/AudioFlinger(241): write blocked for 113 msecs, 34 delayed writes, thread 0x5ecd0
    [COLOR=Red]04-24 09:34:24.580: E/MP3Extractor(241): Unable to resync. Signalling end of stream.
    04-24 09:34:24.580: D/AudioPlayer(241): fillBuffer mSource->read err=-1011
    04-24 09:34:24.580: D/AwesomePlayer(241): postAudioEOS
    04-24 09:34:24.580: D/AwesomePlayer(241): postCheckAudioStatusEvent_l
    04-24 09:34:24.580: D/AudioPlayer(241): size_t [/COLOR]android::AudioPlayer::fillBuffer(void*, size_t) EOS reached, return size =1536
    04-24 09:34:24.580: E/AwesomePlayer(241): onCheckAudioStatus In
    04-24 09:34:24.580: D/AwesomePlayer(241): AUDIO_AT_EOS
    04-24 09:34:24.580: D/AwesomePlayer(241): postStreamDoneEvent_l
    04-24 09:34:24.580: D/AwesomePlayer(241): onStreamDone
    04-24 09:34:24.580: D/AwesomePlayer(241): notifyListener_l
    04-24 09:34:24.580: E/AwesomePlayer(241): calling pause_l
    04-24 09:34:24.580: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=1)
    04-24 09:34:24.580: D/AudioPlayer(241): void android::AudioPlayer::pause(bool)
    04-24 09:34:24.580: V/AudioPolicyManager(241): stopOutput() output 1, stream 3, session 82 mPhoneState 0
    04-24 09:34:24.580: V/AudioPolicyManager(241): getNewDevice() selected device 0
    04-24 09:34:24.580: V/AudioPolicyManager(241): setOutputDevice() output 1 device 0 delayMs 0
    04-24 09:34:24.580: V/AudioPolicyManager(241): setOutputDevice() setting same device 0 or null device for output 1
    04-24 09:34:24.580: W/m.p.Media(4942): Mediaplayer, onCompletion
    04-24 09:34:24.580: D/AwesomePlayer(241): addBatteryData
    04-24 09:34:24.580: E/AwesomePlayer(241): calling reset
    04-24 09:34:24.580: D/AwesomePlayer(241): reset_l
    04-24 09:34:24.580: I/AwesomePlayer(241): cancel player events
    04-24 09:34:24.580: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:34:24.580: D/AudioPlayer(241): void android::AudioPlayer::reset()
    04-24 09:34:24.580: V/AudioPolicyManager(241): releaseOutput() 1
    04-24 09:34:24.580: D/AudioPlayer(241): clear mSource
    04-24 09:34:24.580: D/AudioPlayer(241): AudioPlayer reset done.
    04-24 09:34:24.580: D/AwesomePlayer(241): reset done
    04-24 09:34:24.580: E/AwesomePlayer(241): calling reset
    04-24 09:34:24.580: D/AwesomePlayer(241): reset_l
    04-24 09:34:24.580: I/AwesomePlayer(241): cancel player events
    04-24 09:34:24.580: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:34:24.580: D/AwesomePlayer(241): reset done
    04-24 09:34:24.580: E/AwesomePlayer(241): calling ~AwesomePlayer
    04-24 09:34:24.590: E/AwesomePlayer(241): calling reset
    
    
    Logcat von einem nicht funktionierendem Aufruf:
    Code:
    04-24 09:32:33.820: W/m.p.Media(4661): create MediaPlayer
    04-24 09:32:33.820: D/AwesomePlayer(241): setDefault
    04-24 09:32:33.820: E/AwesomePlayer(241): calling AwesomePlayer
    04-24 09:32:33.820: D/AwesomePlayer(241): setDefault
    04-24 09:32:33.820: E/AwesomePlayer(241): calling reset
    04-24 09:32:33.820: D/AwesomePlayer(241): reset_l
    04-24 09:32:33.820: I/AwesomePlayer(241): cancel player events
    04-24 09:32:33.820: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:32:33.820: D/AwesomePlayer(241): reset done
    04-24 09:32:33.820: D/AwesomePlayer(241): setListener
    04-24 09:32:33.820: D/AwesomePlayer(241): setAudioSink
    04-24 09:32:33.820: D/AwesomePlayer(241): setDataSource
    04-24 09:32:33.820: D/AwesomePlayer(241): reset_l
    04-24 09:32:33.820: I/AwesomePlayer(241): cancel player events
    04-24 09:32:33.820: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:32:33.820: D/FileSource(241): FileSource::FileSource(fd)
    04-24 09:32:33.820: D/AwesomePlayer(241): setDataSource_l
    04-24 09:32:33.820: E/MediaExtractor(241): **********MediaExtractor::Create
    04-24 09:32:33.820: D/DivXPlugin(240): DivXPlugin::onInitialize : 4
    04-24 09:32:33.820: D/DivXPlugin(240): DivXPlugin::onSetOnInfoListener : 4
    04-24 09:32:33.820: D/FileSource(241): FileSource::DrmInitialization(DrmManagerClient* client)::Decrypt handle in NULL creating new DecryptHandle
    04-24 09:32:33.820: D/DivXPlugin(240): DivXPlugin::onTerminate : 4
    04-24 09:32:33.820: E/MediaExtractor(241): ************Autodetected media content as 'audio/mpeg' with confidence 0.20
    04-24 09:32:33.820: I/(241): Found XING header.
    04-24 09:32:33.820: D/AwesomePlayer(241): setDataSource_l
    04-24 09:32:33.820: D/AwesomePlayer(241): setAudioSource
    04-24 09:32:33.820: I/MediaPlayer(4661): prepareAsync called in state 4
    04-24 09:32:33.820: D/AwesomePlayer(241): prepareAsync
    04-24 09:32:33.820: D/AwesomePlayer(241): prepareAsync_l
    04-24 09:32:33.820: D/AwesomePlayer(241): onPrepareAsyncEvent
    04-24 09:32:33.820: D/AwesomePlayer(241): initAudioDecoder
    04-24 09:32:33.820: I/AwesomePlayer(241): Audio duration : 3239183
    04-24 09:32:33.820: D/AwesomePlayer(241): finishAsyncPrepare_l
    04-24 09:32:33.820: D/AwesomePlayer(241): notifyListener_l
    04-24 09:32:33.820: D/AwesomePlayer(241): notifyListener_l
    04-24 09:32:33.820: D/AwesomePlayer(241): setLooping
    04-24 09:32:33.820: D/AwesomePlayer(241): setLooping (0)
    04-24 09:32:33.860: W/m.p.Media(4661): onPrepared()
    04-24 09:32:33.860: D/AwesomePlayer(241): setLooping
    04-24 09:32:33.860: D/AwesomePlayer(241): setLooping (0)
    04-24 09:32:33.860: D/AwesomePlayer(241): setLooping
    04-24 09:32:33.860: D/AwesomePlayer(241): setLooping (0)
    04-24 09:32:33.860: E/AwesomePlayer(241): calling play
    04-24 09:32:33.860: D/AwesomePlayer(241): play
    04-24 09:32:33.860: E/AwesomePlayer(241): calling play_l
    04-24 09:32:33.860: I/AwesomePlayer(241): Not a drm file dude!!!
    04-24 09:32:33.860: D/AwesomePlayer(241): seekAudioIfNecessary_l
    04-24 09:32:33.860: D/AwesomePlayer(241): startAudioPlayer_l  mFlags = 0x15
    04-24 09:32:33.860: D/AudioPlayer(241): android::status_t android::AudioPlayer::start(bool) sourceAlreadyStarted=1 mStarted=0
    04-24 09:32:33.860: D/AudioPlayer(241): mFirstBufferResult =0
    04-24 09:32:33.860: D/AudioPlayer(241): mime =audio/raw
    04-24 09:32:33.860: D/AudioPlayer(241): mAudioSink->open , mSampleRate=44100
    04-24 09:32:33.860: V/AudioPolicyManager(241): startOutput() output 1, stream 3, session 81 mPhoneState 0
    04-24 09:32:33.860: V/AudioPolicyManager(241): startOutput() mLastrefcount 0
    04-24 09:32:33.860: V/AudioPolicyManager(241): getDeviceForStrategy() from cache strategy 0, device 8
    04-24 09:32:33.860: V/AudioPolicyManager(241): getNewDevice() selected device 8
    04-24 09:32:33.860: V/AudioPolicyManager(241): setOutputDevice() output 1 device 8 delayMs 0
    04-24 09:32:33.860: V/AudioPolicyManager(241): setOutputDevice() setting same device 8 or null device for output 1
    04-24 09:32:33.860: I/AudioFlinger(241): start output streamType (0, 3) for 1
    04-24 09:32:33.860: D/AudioHardware(241): AudioStreamOutALSA::setParameters() start_output_streamtype=3
    04-24 09:32:33.860: D/AwesomePlayer(241): addBatteryData
    04-24 09:32:33.860: D/AudioHardware(241): AudioHardware pcm playback is exiting standby.
    04-24 09:32:33.860: V/AudioHardware(241): open pcm_out driver
    04-24 09:32:33.860: I/AudioHardware(241): openPcmOut_l() mPcmOpenCnt: 0
    04-24 09:32:33.860: V/alsa_pcm(241): pcm_open(0x00027000)
    04-24 09:32:33.860: V/alsa_pcm(241): pcm_open() period sz multiplier 8
    04-24 09:32:33.860: V/alsa_pcm(241): pcm_open() period cnt 4
    04-24 09:32:33.920: V/alsa_pcm(241): pcm_open() period_cnt 4 period_sz 1024 channels 2
    04-24 09:32:33.920: V/alsa_pcm(241): pcm_open end
    04-24 09:32:33.920: V/AudioHardware(241): openPcmOut_l end
    04-24 09:32:33.920: V/AudioHardware(241): openMixer_l() mMixerOpenCnt: 0
    04-24 09:32:33.920: V/alsa_mixer(241): mixer_open
    04-24 09:32:33.920: V/alsa_mixer(241): mixer_open end
    04-24 09:32:33.920: V/AudioHardware(241): openMixer_l end
    04-24 09:32:33.920: V/AudioHardware(241): open playback normal
    04-24 09:32:33.920: V/AudioHardware(241): write() wakeup setting route HP_NO_MIC
    04-24 09:32:33.920: V/alsa_mixer(241): mixer_ctl_select HP_NO_MIC
    04-24 09:32:33.940: I/System.out(406): [INFO:2837293]: LogSource: Response [http=200,length=171]
    04-24 09:32:33.940: I/System.out(406): [INFO:2837293]: LogSource: Read id 5285, status code 200
    04-24 09:32:33.970: I/AudioHardware(241): mSetVolumeIndex=0, mIsMusicPlaying=1, musicvolumeindex=7
    04-24 09:32:33.970: V/AudioHardware(241): openMixer_l() mMixerOpenCnt: 1
    04-24 09:32:33.970: V/AudioHardware(241): openMixer_l end
    04-24 09:32:33.970: V/AudioHardware(241): setMusicVolumeIndex Headset Volume Control
    04-24 09:32:33.970: V/alsa_mixer(241): mixer_ctl_select 7
    04-24 09:32:33.970: V/AudioHardware(241): closeMixer_l() mMixerOpenCnt: 2
    04-24 09:32:33.970: V/AudioHardware(241): closeMixer_l mMixerOpenCnt = 1 end
    04-24 09:32:33.970: W/AudioFlinger(241): write blocked for 108 msecs, 33 delayed writes, thread 0x5ecd0
    04-24 09:32:34.170: I/System.out(406): [INFO:2837523]: LogSource: Running flush
    04-24 09:32:34.170: I/System.out(406): [INFO:2837524]: LogSource: Sending payload [bytes=233]
    04-24 09:32:34.300: D/dalvikvm(4661): GC_CONCURRENT freed 2049K, 13% free 16372K/18631K, paused 2ms+4ms
    [COLOR=Red]04-24 09:32:34.300: E/AwesomePlayer(241): calling reset
    04-24 09:32:34.300: D/AwesomePlayer(241): reset_l
    04-24 09:32:34.300: D/AwesomePlayer(241): addBatteryData
    04-24 09:32:34.300: I/AwesomePlayer(241): cancel player events
    04-24 09:32:34.300: D/AwesomePlayer(241): cancelPlayerEvents [/COLOR](keepBufferingGoing=0)
    04-24 09:32:34.300: D/AudioPlayer(241): void android::AudioPlayer::reset()
    04-24 09:32:34.300: V/AudioPolicyManager(241): stopOutput() output 1, stream 3, session 81 mPhoneState 0
    04-24 09:32:34.300: V/AudioPolicyManager(241): getNewDevice() selected device 0
    04-24 09:32:34.300: V/AudioPolicyManager(241): setOutputDevice() output 1 device 0 delayMs 0
    04-24 09:32:34.300: V/AudioPolicyManager(241): setOutputDevice() setting same device 0 or null device for output 1
    04-24 09:32:34.300: V/AudioPolicyManager(241): releaseOutput() 1
    04-24 09:32:34.300: D/AudioPlayer(241): clear mSource
    04-24 09:32:34.300: D/AudioPlayer(241): AudioPlayer reset done.
    04-24 09:32:34.300: D/AwesomePlayer(241): reset done
    04-24 09:32:34.300: E/AwesomePlayer(241): calling reset
    04-24 09:32:34.300: D/AwesomePlayer(241): reset_l
    04-24 09:32:34.300: I/AwesomePlayer(241): cancel player events
    04-24 09:32:34.300: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:32:34.300: D/AwesomePlayer(241): reset done
    04-24 09:32:34.300: E/AwesomePlayer(241): calling ~AwesomePlayer
    04-24 09:32:34.300: E/AwesomePlayer(241): calling reset
    04-24 09:32:34.300: D/AwesomePlayer(241): reset_l
    04-24 09:32:34.300: I/AwesomePlayer(241): cancel player events
    04-24 09:32:34.300: D/AwesomePlayer(241): cancelPlayerEvents (keepBufferingGoing=0)
    04-24 09:32:34.300: D/AwesomePlayer(241): reset done
    
    
    Der Player resetet.... da wird zuvor zwar etwas Speicher freigegeben, aber wie ne Fehlermeldung sieht das für mich erstmal nicht aus.
    Wenn wenigstens der OnErrorListener aufgerufen werden würde...

    In der MapActitivtiy oder aus einem anderen Thread heraus wird übrigens überhaupt nicht auf den Mediaplayer zugegriffen.
     
  4. Quarki, 24.04.2012 #4
    Quarki

    Quarki Threadstarter Neuer Benutzer

    Beiträge:
    7
    Erhaltene Danke:
    0
    Registriert seit:
    07.12.2011
    Lösung:
    1. Mediaplayer als Klassen-Attribut und nicht als Lokale Variable benutzen
    2. in der onPause() Methode die release() Methode der Instanz des MediaPlayers aufrufen
     

Diese Seite empfehlen