问题发生时,我终于有机会查看logcat。错误消息显示为:
Completed command PLAYER_PREPARE status=-17
根据该论坛的说法,“这是由于一次激活了太多MediaPlayer对象引起的。” 不幸的是我还没有找到解决方法。唯一已知的解决方法似乎是重新启动。
我仍然不确定哪个应用程序(或应用程序组合)可靠地重现该错误。
编辑:我想任何使用MediaPlayer类的应用程序都可能导致此问题。这些应用可能永远都不会达到调用MediaPlayer.release()的状态。也许我们需要联系使用MediaPlayer的应用程序的供应商,以便他们确保他们调用release()。
我的肤浅研究并未得出解决方案,该解决方案无需重启即可解决问题。
编辑2:我已更新至Android 2.3(Gingerbread),但不幸的是,此问题仍然存在。
有关错误的一些logcat消息:
06-08 20:03:08.785 V/PlayerDriver( 2377): CommandCompleted
06-08 20:03:08.785 V/PlayerDriver( 2377): Completed command PLAYER_INIT status=1
06-08 20:03:08.785 V/PVPlayer( 2377): run_set_video_surface s=0, cancelled=0
06-08 20:03:08.785 V/PVPlayer( 2377): run_set_audio_output s=0, cancelled=0
06-08 20:03:08.785 V/PlayerDriver( 2377): Send player code: 5
06-08 20:03:08.785 V/PlayerDriver( 2377): Create realtime output
06-08 20:03:08.785 V/PlayerDriver( 2377): CommandCompleted
06-08 20:03:08.785 V/PlayerDriver( 2377): Completed command PLAYER_SET_AUDIO_SINK status=1
06-08 20:03:08.785 V/PVPlayer( 2377): run_prepare s=0, cancelled=0
06-08 20:03:08.789 V/PlayerDriver( 2377): Send player code: 7
06-08 20:03:08.789 V/PlayerDriver( 2377): disable natpkt - 0
06-08 20:03:08.789 D/ ( 2377): After GetDurationFromRandomScan: clipDuration=8716644
06-08 20:03:08.789 D/ ( 2377): After GetDurationFromRandomScan: clipDuration=8716644
06-08 20:03:08.804 V/PlayerDriver( 2377): HandleInformationalEvent: 26
06-08 20:03:08.804 V/PlayerDriver( 2377): HandleInformationalEvent: type=26 UNHANDLED
06-08 20:03:08.804 V/PlayerDriver( 2377): CommandCompleted
06-08 20:03:08.804 V/PlayerDriver( 2377): Completed command PLAYER_PREPARE status=-17
06-08 20:03:08.804 E/PlayerDriver( 2377): Command PLAYER_PREPARE completed with an error or info -17
06-08 20:03:08.804 V/PVPlayer( 2377): check_for_live_streaming s=-2147483648, cancelled=0
06-08 20:03:08.804 V/PlayerDriver( 2377): HandleInformationalEvent: 27
06-08 20:03:08.804 W/PlayerDriver( 2377): PVMFInfoErrorHandlingComplete
06-08 20:03:08.804 W/MediaPlayer(22989): info/warning (1, 26)
06-08 20:03:08.804 E/MediaPlayer(22989): error (1, -17)
06-08 20:03:08.808 I/AudioService( 2471): AudioFocus abandonAudioFocus() from android.media.AudioManager@480f3630null
06-08 20:03:08.812 I/AudioService( 2471): AudioFocus abandonAudioFocus() from android.media.AudioManager@480f3630null
06-08 20:03:08.812 D/PlayTo (22989): opening content://dtmedia/media/1553 with Android Player
06-08 20:03:08.812 D/PlayTo (22989): About to set Android Player datasource to content://dtmedia/media/1553
06-08 20:03:08.812 E/PVPlayer( 2377): isDrmfile playing 0
06-08 20:03:08.812 V/PVPlayer( 2377): reset
06-08 20:03:08.812 V/PlayerDriver( 2377): Send player code: 18
06-08 20:03:08.812 V/PlayerDriver( 2377): handleCancelAllCommands
06-08 20:03:08.816 V/PlayerDriver( 2377): CommandCompleted
06-08 20:03:08.816 V/PlayerDriver( 2377): Completed command PLAYER_CANCEL_ALL_COMMANDS status=1
06-08 20:03:08.816 V/PlayerDriver( 2377): Send player code: 11
06-08 20:03:08.816 V/PlayerDriver( 2377): handleReset
06-08 20:03:08.816 V/PlayerDriver( 2377): CommandCompleted
06-08 20:03:08.816 V/PlayerDriver( 2377): Completed command PLAYER_RESET status=1
06-08 20:03:08.816 V/PlayerDriver( 2377): Send player code: 17
06-08 20:03:08.816 V/PlayerDriver( 2377): handleRemoveDataSource
06-08 20:03:08.816 V/PlayerDriver( 2377): CommandCompleted
06-08 20:03:08.816 V/PlayerDriver( 2377): Completed command PLAYER_REMOVE_DATA_SOURCE status=1
06-08 20:03:08.816 V/PVPlayer( 2377): unmap file