多次播放后Android Video停止播放错误1,2147483648 [英] Android Video stops playing after multiple plays Error 1, 2147483648

查看:92
本文介绍了多次播放后Android Video停止播放错误1,2147483648的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这有点令人沮丧,我已经搜索了Stack,但是没有一个答案似乎有帮助.

OK, this is a little frustrating, and I have searched Stack but none of the answers seems to help.

我有一个Android应用程序,可以在屏幕上循环显示不同的内容.它一度播放从同一位置加载的视频,同一视频.

I have an Android app which cycles through different content on the screen. At one point it plays a video, the same video, loaded from the same place.

经过随机播放后,它决定停止播放视频文件,并在(-2147483648)以上抛出错误,该错误是找不到通用文件/格式错误的错误.

After a random number of plays, it decides to stop playing the video file and throws the error up above (-2147483648) which is a generic file not found / incorrect format error.

问题在于,在出现此错误之前,视频可以正常播放多次.我尝试了多种替代方法来解决此问题:

The problem is the video plays correctly numerous times before this error comes up. I have tried a number of alternatives to fixing this:

  • 播放文件的VideoView(开始)
  • 从文件读取MediaPlayer + SurfaceView组合
  • MediaPlayer + SurfaceView从文件描述符读取
  • 强制授予全世界可读的权限
  • 将文件复制到临时文件并播放
  • 手动释放VideoView和MediaPlayer选项的媒体播放器
  • 每次播放后运行手动垃圾回收

但是,在多次播放之后,最终,它将拒绝播放视频.

and yet still, after multiple plays, eventually, it will refuse to play the video.

一个可能不相关的更改是,从文件描述符播放时,它引发了媒体播放器准备的Java I/O异常,我认为这与文件上可能发生某种锁定有关.

One change which might or might no be relevant is when playing from a file descriptor it throws a mediaplayer prepare Java I/O Exception which I believe is related to perhaps there is somehow some locking happening on the file.

解决此问题的唯一方法是重新启动设备.重新启动该应用程序不能解决该问题,它会立即拒绝播放该文件.

The only way to fix this is to reboot the device. Restarting the app does not fix it and it immediately will refuse to play the file.

这是VideoView播放代码:

Here is the VideoView playing code:

// from main activity
File afile = new File(btvapp.fileroot,btvapp.getDailyVideo().get("FILENAME"));        
afile.setReadable(true, false);
theVideo = (VideoView) findViewById(R.id.videoViewer);
theVideo.requestFocus();
theVideo.setVideoPath(afile.getPath());
theVideo.setOnPreparedListener(this);
theVideo.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
    @Override
    public void onCompletion(MediaPlayer mp) {
        // TODO Auto-generated method stub
        //mp.release();
        theVideo.stopPlayback();
        mp.release();
            finish();

    }
} );
theVideo.setOnErrorListener(new MediaPlayer.OnErrorListener() {
    @Override
    public boolean onError(MediaPlayer mp, int what, int extra) {
            finish();
            return false;
        }
    });

// play on prepared function
@Override
  public void onPrepared(MediaPlayer mp) {
  // TODO Auto-generated method stub
  mp.start();
}

表面视图几乎完全使用Android SDK媒体播放示例,但是我认为不值得粘贴代码,因为无论您使用mediaplayer + surfaceview方法还是VideoView播放方法,都会发生错误.

The surface view uses the Android SDK mediaplaying example almost exactly, but I don't think it's worth pasting the code, since the error happens regardless of whether you use the mediaplayer + surfaceview method OR the VideoView playback method.

有什么想法吗?使我发疯.

Thoughts? Driving me crazy.

更新:这是完整的日志,包括主应用程序和衍生的视频活动

UPDATE: Here's the full log including the main app and the spawned video activity

07-19 18:47:02.844: V/videpath(7232): /mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4
07-19 18:47:03.014: I/dalvikvm(7232): threadid=1: recursive native library load attempt (/system/lib/libmedia_jni.so)
07-19 18:47:03.014: D/MtpDeviceJNI(7232): register_android_mtp_MtpDevice
07-19 18:47:03.014: I/dalvikvm(7232): threadid=1: recursive native library load attempt (/system/lib/libmedia_jni.so)
07-19 18:47:03.014: I/dalvikvm(7232): threadid=1: recursive native library load attempt (/system/lib/libmedia_jni.so)
07-19 18:47:03.024: V/MediaPlayerService(87): Client(56) constructor
07-19 18:47:03.024: V/MediaPlayerService(87): Create new client(56) from pid 7232, uid 10043, 
07-19 18:47:03.034: V/MediaPlayerService(87): setDataSource(/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4)
07-19 18:47:03.034: V/MediaPlayerService(87): media.amsuperplayer.enable is enabled
07-19 18:47:03.034: V/MediaPlayerService(87): media.amsuperplayer.enable is enabled
07-19 18:47:03.034: V/MediaPlayerService(87): player type = 6
07-19 18:47:03.034: V/MediaPlayerService(87): Create AmSuperPlayer
07-19 18:47:03.034: V/AmSuperPlayer(87): [AmSuperPlayer::74]
07-19 18:47:03.034: V/AmSuperPlayer(87): [AmSuperPlayer::76]
07-19 18:47:03.034: V/AmSuperPlayer(87): AmSuperPlayer init now
07-19 18:47:03.034: V/AmSuperPlayer(87): [onFirstRef::103]
07-19 18:47:03.034: V/AmSuperPlayer(87): [initCheck::110]
07-19 18:47:03.034: V/AmSuperPlayer(87): [initCheck::112]
07-19 18:47:03.034: V/AmSuperPlayer(87): [setNotifyCallback::455]
07-19 18:47:03.034: V/AmSuperPlayer(87): [hardwareOutput::330]
07-19 18:47:03.034: V/AmSuperPlayer(87): [hardwareOutput::332]
07-19 18:47:03.034: V/AudioSink(87): AudioOutput(112)
07-19 18:47:03.034: V/MediaPlayerService(87):  setDataSource
07-19 18:47:03.034: V/AmSuperPlayer(87): [setDataSource::118]
07-19 18:47:03.034: V/AmSuperPlayer(87): [setDataSource::120]
07-19 18:47:03.034: V/MediaPlayerService(87): [56] setVideoSurfaceTexture(0x28290)
07-19 18:47:03.034: V/AmSuperPlayer(87): [setVideoSurfaceTexture::168]
07-19 18:47:03.034: V/AmSuperPlayer(87): [setVideoSurfaceTexture::170]
07-19 18:47:03.034: V/MediaPlayerService(87): [56] setVideoSurfaceTexture(0x29660)
07-19 18:47:03.034: V/MediaPlayerService(87): [56] setAudioStreamType(3)
07-19 18:47:03.034: V/MediaPlayerService(87): [56] prepareAsync
07-19 18:47:03.034: V/AmSuperPlayer(87): [prepareAsync::199]
07-19 18:47:03.034: V/AmSuperPlayer(87): [prepareAsync::202]
07-19 18:47:03.034: V/AmSuperPlayer(87): initThread(7388) started
07-19 18:47:03.034: V/AmSuperPlayer(87): createPlayer
07-19 18:47:03.034: V/AmSuperPlayer(87): Create Amlogic Player
07-19 18:47:03.034: V/AmlogicPlayer(87): AmlogicPlayer constructor
07-19 18:47:03.034: I/AmlogicPlayer(87): media.amplayer.stopbuflevel is not set
07-19 18:47:03.034: V/AmlogicPlayer(87): onFirstRef
07-19 18:47:03.034: I/AmlogicPlayer(87): found 0 not exit player threads,try exit it now
07-19 18:47:03.034: V/AmlogicPlayer(87): initCheck
07-19 18:47:03.034: V/AmSuperPlayer(87): [CreatePlayer::678]
07-19 18:47:03.034: V/AmlogicPlayer(87): setDataSource
07-19 18:47:03.034: V/AmlogicPlayer(87): History mgt old[,0,-1]
07-19 18:47:03.034: V/AmlogicPlayer(87): History mgt    [/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4,0,0]
07-19 18:47:03.034: V/AmlogicPlayer(87): setDataSource url=/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4, len=63
07-19 18:47:03.034: V/AmlogicPlayer(87): Set setVideoSurfaceTexture
07-19 18:47:03.034: I/AmlogicPlayer(87): media.amplayer.lpbufferlevel is not set
07-19 18:47:03.034: I/AmlogicPlayer(87): media.amplayer.buffertime is not set
07-19 18:47:03.034: V/AmlogicPlayer(87): prepareAsync
07-19 18:47:03.034: I/AmlogicPlayer(87): media.amplayer.noaudio is disabled
07-19 18:47:03.034: I/AmlogicPlayer(87): media.amplayer.novideo is disabled
07-19 18:47:03.034: V/AmlogicPlayer(87): buffer level setting is:0.001000-0.020000-0.800000
07-19 18:47:03.034: V/AmlogicPlayer(87): prepareAsync,file_name=/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4
07-19 18:47:03.034: I/amplayer(87): LibPlayer version:Version:2.1.0.
07-19 18:47:03.034: I/amplayer(87): LibPlayer git version:
07-19 18:47:03.034: I/amplayer(87): LibPlayer version serial:201000000000000
07-19 18:47:03.034: I/amplayer(87): LibPlayer Last Changed:
07-19 18:47:03.034: I/amplayer(87): LibPlayer Last Build: Tue May 22 17:40:26 HKT 2012
07-19 18:47:03.034: I/amplayer(87): LibPlayer Builer Name: clei
07-19 18:47:03.034: I/amplayer(87): [player_start:enter]p=0x2a98dc black=0
07-19 18:47:03.034: I/amplayer(87): ***player_para=0x112d28,start_param=0x2a98dc
07-19 18:47:03.034: I/amplayer(87): [player_thread_create:70]creat thread success,tid=149280
07-19 18:47:03.034: I/amplayer(87): [player_start:exit]pid = 23 
07-19 18:47:03.034: V/AmlogicPlayer(87): Start player,pid=23
07-19 18:47:03.034: I/amplayer(87): pid[23]::enter into player_thread
07-19 18:47:03.034: I/amplayer(87): pid[23]::Init State: mute_on=0 black=0 t_pos:1074106323s read_max_cnt=0
07-19 18:47:03.034: I/amplayer(87): file::::[/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4],len=63
07-19 18:47:03.154: I/amplayer(87): **[update_state]pid:23 status=BEGIN_INIT(last:UNKNOW_STATE) err=0x0 curtime=0 (ms:0) fulltime=0 lsttime=0
07-19 18:47:03.154: I/amplayer(87): **[update_state]abuflevel=0.000 vbublevel=0.000 abufrp=0 vbufrp=0 read_end=0
07-19 18:47:03.154: V/AmlogicPlayer(87): update_process pid=23, current=0,status=[BEGIN_INIT]
07-19 18:47:03.154: V/AmlogicPlayer(87): Playing percent =0,mPlayTime:0,mStreamTime:0
07-19 18:47:03.154: V/AmSuperPlayer(87): [notify::404]
07-19 18:47:03.154: V/AmSuperPlayer(87): [Notify::411]
07-19 18:47:03.154: V/AmSuperPlayer(87): cookie=0x475e0,msg=3,ext1=0,ext2=0
07-19 18:47:03.154: I/amplayer(87): [ffmpeg_open_file] file=/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4,header=
07-19 18:47:03.154: I/amplayer(87): ffmpeg error: Couldn't open input file! ret==ffffffe8
07-19 18:47:03.154: I/amplayer(87): [player_dec_init]ffmpeg_open_file failed(/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4)*****ret=fcffffff!
07-19 18:47:03.154: I/amplayer(87): pid[23]player_thread release0 begin...(sta:0x30001)
07-19 18:47:03.154: I/amplayer(87): [get_pts_video]No codec handler
07-19 18:47:03.154: I/amplayer(87): **[update_state]pid:23 status=ERROR(last:BEGIN_INIT) err=0x3000001 curtime=0 (ms:0) fulltime=0 lsttime=0
07-19 18:47:03.154: I/amplayer(87): **[update_state]abuflevel=0.000 vbublevel=0.000 abufrp=0 vbufrp=0 read_end=0
07-19 18:47:03.154: V/AmlogicPlayer(87): update_process pid=23, current=0,status=[ERROR]
07-19 18:47:03.154: V/AmSuperPlayer(87): [notify::404]
07-19 18:47:03.154: V/AmSuperPlayer(87): [Notify::411]
07-19 18:47:03.154: V/AmSuperPlayer(87): cookie=0x475e0,msg=64,ext1=1,ext2=fcffffff
07-19 18:47:03.154: V/AmSuperPlayer(87): [CreatePlayer::702]
07-19 18:47:03.154: I/AmSuperPlayer(87): media.amplayer.enable is enabled
07-19 18:47:03.154: I/AmSuperPlayer(87): media.stagefright.enable-player is disabled
07-19 18:47:03.154: V/AmSuperPlayer(87): [CreatePlayer::713]
07-19 18:47:03.154: V/AmSuperPlayer(87): Need to creat new player=3
07-19 18:47:03.154: V/AmlogicPlayer(87): stop
07-19 18:47:03.154: I/amplayer(87): [player_stop:enter]pid=23
07-19 18:47:03.154: I/amplayer(87): [player_stop]player_status=30001
07-19 18:47:03.154: I/amplayer(87): [player_stop]pid=23 thread is already stopped
07-19 18:47:03.154: V/AmlogicPlayer(87): AmlogicPlayer destructor
07-19 18:47:03.154: V/AmlogicPlayer(87): release
07-19 18:47:03.154: V/AmlogicPlayer(87): [release::1461]
07-19 18:47:03.154: I/amplayer(87): [player_stop:enter]pid=23
07-19 18:47:03.154: I/amplayer(87): [player_stop]player_status=30001
07-19 18:47:03.154: I/amplayer(87): [player_stop]pid=23 thread is already stopped
07-19 18:47:03.154: I/amplayer(87): [player_exit:enter]pid=23
07-19 18:47:03.154: I/amplayer(87): [player_exit]player_state=0x30001
07-19 18:47:03.154: I/amplayer(87): [player_stop:enter]pid=23
07-19 18:47:03.154: I/amplayer(87): [player_stop]player_status=30001
07-19 18:47:03.154: I/amplayer(87): [player_stop]pid=23 thread is already stopped
07-19 18:47:03.154: I/amplayer(87): [player_thread_wait_exit:80]pid=[23] thead_id=149280
07-19 18:47:03.154: V/AmlogicPlayer(87): Player status:ERROR, error occur
07-19 18:47:03.154: V/AmSuperPlayer(87): [notify::404]
07-19 18:47:03.154: V/AmSuperPlayer(87): [Notify::411]
07-19 18:47:03.154: V/AmSuperPlayer(87): cookie=0x475e0,msg=64,ext1=1,ext2=ffffffff
07-19 18:47:03.154: I/amplayer(87): **[update_state]pid:23 status=EXIT(last:ERROR) err=0x0 curtime=0 (ms:0) fulltime=0 lsttime=0
07-19 18:47:03.154: I/amplayer(87): **[update_state]abuflevel=0.000 vbublevel=0.000 abufrp=0 vbufrp=0 read_end=0
07-19 18:47:03.154: V/AmlogicPlayer(87): update_process pid=23, current=0,status=[EXIT]
07-19 18:47:03.154: V/AmlogicPlayer(87): Player status:EXIT, playback exit
07-19 18:47:03.154: I/amplayer(87): pid[23]::stop play, exit player thead!(sta:0x30004)
07-19 18:47:03.154: I/amplayer(87): [player_thread_wait_exit:86]thead_id=149280 returning
07-19 18:47:03.154: I/amplayer(87): [player_exit]player thread already exit: 0
07-19 18:47:03.154: I/amplayer(87): [player_release_pid:72]release pid=23
07-19 18:47:03.154: I/amplayer(87): [player_exit:exit]pid=23
07-19 18:47:03.154: V/AmlogicPlayer(87): set fs/sys/class/video/disable_video=2 failed
07-19 18:47:03.154: I/amplayer(87): ENABLE_FREE_SCALE not define!
07-19 18:47:03.154: I/amplayer(87): [get_display_mode]display_mode=fail
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb0/scale fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb1/scale fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb1/scale_axis fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb0/blank fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb1/blank fail.
07-19 18:47:03.154: I/amplayer(87): [get_display_mode]display_mode=fail
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb0/free_scale fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/graphics/fb1/free_scale fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/video/axis fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/ppmgr/ppscaler fail.
07-19 18:47:03.154: I/amplayer(87): open /sys/class/ppmgr/ppscaler_rect fail.
07-19 18:47:03.154: I/amplayer(87): display mode: 292344
07-19 18:47:03.154: I/amplayer(87): [enable_freescale_MBX]set video axis: 0 0 0 0 
07-19 18:47:03.154: V/AmlogicPlayer(87): VideoViewClose=-33554433
07-19 18:47:03.154: V/AmlogicPlayer(87): [release::1471]
07-19 18:47:03.154: V/AmlogicPlayer(87): History mgt old[,0,-1]
07-19 18:47:03.154: V/AmlogicPlayer(87): History mgt    [/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4,1,0]
07-19 18:47:03.154: V/AmSuperPlayer(87): createPlayer
07-19 18:47:03.154: V/AmSuperPlayer(87):  create StagefrightPlayer
07-19 18:47:03.154: V/AmSuperPlayer(87): [CreatePlayer::678]
07-19 18:47:03.154: I/AwesomePlayer(87): setDataSource_l('/mnt/sdcard/Android/data/au.com.nian.bullertv/files/tmpbtag.mp4')
07-19 18:47:03.154: V/AmSuperPlayer(87): [CreatePlayer::713]
07-19 18:47:03.154: V/AmSuperPlayer(87): [CreatePlayer::729]
07-19 18:47:03.154: V/AmSuperPlayer(87): Start new player now=3
07-19 18:47:03.154: V/AmSuperPlayer(87): [initThread::762]
07-19 18:47:03.154: V/AmSuperPlayer(87): [notify::404]
07-19 18:47:03.154: V/AmSuperPlayer(87): [Notify::411]
07-19 18:47:03.154: V/AmSuperPlayer(87): cookie=0x475e0,msg=64,ext1=1,ext2=80000000
07-19 18:47:03.154: V/MediaPlayerService(87): [56] notify (0x23d50, 100, 1, -2147483648)
07-19 18:47:03.154: **E/MediaPlayer(7232): error (1, -2147483648)**
07-19 18:47:03.154: V/videoerr(7232): java.io.IOException: Prepare failed.: status=0x1

更新2:我已经在另外2个Android设备(1个ICS,1个Gingerbread)上测试了该代码,但令人讨厌的是,该代码在它们上运行良好,并且运行了12个小时以上而没有发生故障.因此,这似乎是平台错误,但仍然需要解决此问题.

UPDATE 2: I have tested the code on 2 other Android devices (one ICS, one Gingerbread) and annoyingly it works fine on them and ran for over 12 hours without incident. So, it looks to be a platform error, but still need to solve this.

推荐答案

我几乎肯定这是您正在使用的基于Amlogic的设备的问题(由于logcat中的"amplayer"和"AmlogicPlayer"而明显).我们正在测试的基于Amlogic AML8726的设备存在很多问题.尝试升级固件.

I'm almost positive this is an issue with the Amlogic based device you are using (evident due to the "amplayer" and "AmlogicPlayer" in the logcat). We have had tons of issues with an Amlogic AML8726 based device we are testing. Try upgrading the firmware if possible.

这篇关于多次播放后Android Video停止播放错误1,2147483648的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆