Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ijkplayer demo,播放一段视频,退出再播放,重复几次,手机卡住! #732

Closed
xiaoyaomeng opened this issue Dec 16, 2015 · 47 comments

Comments

@xiaoyaomeng
Copy link

ijkplayer demo,播放一段视频,退出再播放,重复几次,退到demo的选择列表后,手机卡住!
这时候只有HOME键能按,其他的键都失灵。不明白是什么问题导致的。MTK6795

@bbcallen
Copy link
Contributor

Which version are you using?
Any ANR trace log?

@xiaoyaomeng
Copy link
Author

@bbcallen 我是大概12月5号下拉的版本,没有抛出ANR,但却按不了。我提供一下“IJKMEDIA”的Log

12-16 11:39:33.028: D/IJKMEDIA(14723): java.nio.ByteBuffer class loaded
12-16 11:39:33.028: I/IJKMEDIA(14723): MediaCodec: API-22
12-16 11:39:33.033: D/IJKMEDIA(14723): android.media.MediaCodec$BufferInfo class loaded
12-16 11:39:33.033: D/IJKMEDIA(14723): android.media.MediaCodec class loaded
12-16 11:39:33.036: D/IJKMEDIA(14723): IjkMediaPlayer_native_profileBegin
12-16 11:39:33.036: D/IJKMEDIA(14723): monstartup: libijkplayer.so
12-16 11:39:33.121: D/IJKMEDIA(14723): IjkMediaPlayer_native_init
12-16 11:39:33.121: D/IJKMEDIA(14723): IjkMediaPlayer_native_setup
12-16 11:39:33.121: I/IJKMEDIA(14723): av_version_info: ff2.8--ijk0.4.1.1--dev0.3.3--rc4
12-16 11:39:33.122: D/IJKMEDIA(14723): ffpipeline_create_from_android()
12-16 11:39:33.122: D/IJKMEDIA(14723): ijkmp_set_inject_opaque(0x1010fe)
12-16 11:39:33.122: D/IJKMEDIA(14723): ijkmp_set_inject_opaque()=void
12-16 11:39:33.122: D/IJKMEDIA(14723): ijkmp_android_set_mediacodec_select_callback()
12-16 11:39:33.122: D/IJKMEDIA(14723): ffpipeline_set_mediacodec_select_callback
12-16 11:39:33.122: D/IJKMEDIA(14723): ijkmp_android_set_mediacodec_select_callback()=void
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_native_setLogLevel(3)
12-16 11:39:33.122: D/IJKMEDIA(14723): moncleanup
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.122: D/IJKMEDIA(14723): IjkMediaPlayer_setOptionLong
12-16 11:39:33.123: D/IJKMEDIA(14723): IjkMediaPlayer_setDataSourceAndHeaders
12-16 11:39:33.123: V/IJKMEDIA(14723): setDataSource: path /storage/emulated/legacy/SmartCamera/Videos/EYED_201512161110_2496.MP4
12-16 11:39:33.123: D/IJKMEDIA(14723): ijkmp_set_data_source(url="/storage/emulated/legacy/SmartCamera/Videos/EYED_201512161110_2496.MP4")
12-16 11:39:33.123: D/IJKMEDIA(14723): ijkmp_set_data_source(url="/storage/emulated/legacy/SmartCamera/Videos/EYED_201512161110_2496.MP4")=0
12-16 11:39:33.123: D/IJKMEDIA(14723): IjkMediaPlayer_setVideoSurface
12-16 11:39:33.123: D/IJKMEDIA(14723): ijkmp_set_android_surface(surface=0xff8c9ff0)
12-16 11:39:33.123: D/IJKMEDIA(14723): ffpipeline_set_surface()
12-16 11:39:33.123: D/IJKMEDIA(14723): ijkmp_set_android_surface(surface=0xff8c9ff0)=void
12-16 11:39:33.123: D/IJKMEDIA(14723): IjkMediaPlayer_prepareAsync
12-16 11:39:33.123: D/IJKMEDIA(14723): ijkmp_prepare_async()
12-16 11:39:33.123: I/IJKMEDIA(14723): ===== versions =====
12-16 11:39:33.123: I/IJKMEDIA(14723): FFmpeg : ff2.8--ijk0.4.1.1--dev0.3.3--rc4
12-16 11:39:33.123: I/IJKMEDIA(14723): libavutil : 54.31.100
12-16 11:39:33.123: I/IJKMEDIA(14723): SDL_RunThread: [14758] ff_msg_loop
12-16 11:39:33.123: I/IJKMEDIA(14723): libavcodec : 56.60.100
12-16 11:39:33.123: I/IJKMEDIA(14723): libavformat : 56.40.101
12-16 11:39:33.123: D/IJKMEDIA(14723): message_loop
12-16 11:39:33.123: I/IJKMEDIA(14723): libswscale : 3.1.101
12-16 11:39:33.123: I/IJKMEDIA(14723): libswresample: 1.2.101
12-16 11:39:33.123: I/IJKMEDIA(14723): ===== options =====
12-16 11:39:33.123: I/IJKMEDIA(14723): player-opts : mediacodec = 1
12-16 11:39:33.123: I/IJKMEDIA(14723): player-opts : mediacodec-auto-rotate = 0
12-16 11:39:33.123: I/IJKMEDIA(14723): player-opts : opensles = 0
12-16 11:39:33.123: I/IJKMEDIA(14723): player-opts : overlay-format = 842225234
12-16 11:39:33.123: I/IJKMEDIA(14723): player-opts : framedrop = 1
12-16 11:39:33.123: I/IJKMEDIA(14723): player-opts : start-on-prepared = 0
12-16 11:39:33.123: I/IJKMEDIA(14723): format-opts : ijkinject-opaque = 1052926
12-16 11:39:33.123: I/IJKMEDIA(14723): format-opts : http-detect-range-support = 0
12-16 11:39:33.123: I/IJKMEDIA(14723): codec-opts : skip_loop_filter = 48
12-16 11:39:33.123: I/IJKMEDIA(14723): ===================
12-16 11:39:33.124: D/IJKMEDIA(14723): FFP_MSG_FLUSH:
12-16 11:39:33.125: I/IJKMEDIA(14723): SDL_RunThread: [14759] ff_vout
12-16 11:39:33.125: D/IJKMEDIA(14723): ijkmp_prepare_async()=0
12-16 11:39:33.125: I/IJKMEDIA(14723): SDL_RunThread: [14760] ff_read
12-16 11:39:33.168: D/IJKMEDIA(14723): Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
12-16 11:39:33.169: D/IJKMEDIA(14723): ISO: File Type Major Brand: mp42
12-16 11:39:33.176: E/IJKMEDIA(14723): Option ijkinject-opaque not found.
12-16 11:39:33.176: D/IJKMEDIA(14723): Before avformat_find_stream_info() pos: 197789314 bytes read:327680 seeks:2
12-16 11:39:33.189: D/IJKMEDIA(14723): no picture
12-16 11:39:33.250: D/IJKMEDIA(14723): All info found
12-16 11:39:33.252: D/IJKMEDIA(14723): After avformat_find_stream_info() pos: 654442 bytes read:458752 seeks:3 frames:3
12-16 11:39:33.252: I/IJKMEDIA(14723): max_frame_duration: 10.000
12-16 11:39:33.252: I/IJKMEDIA(14723): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/legacy/SmartCamera/Videos/EYED_201512161110_2496.MP4':
12-16 11:39:33.252: I/IJKMEDIA(14723): Metadata:
12-16 11:39:33.252: I/IJKMEDIA(14723): major_brand :
12-16 11:39:33.252: I/IJKMEDIA(14723): mp42
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): minor_version :
12-16 11:39:33.252: I/IJKMEDIA(14723): 0
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): compatible_brands:
12-16 11:39:33.252: I/IJKMEDIA(14723): mp42isom
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): creation_time :
12-16 11:39:33.252: I/IJKMEDIA(14723): 2015-12-16 11:10:33
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): Duration:
12-16 11:39:33.252: I/IJKMEDIA(14723): 00:01:00.48
12-16 11:39:33.252: I/IJKMEDIA(14723): , start:
12-16 11:39:33.252: I/IJKMEDIA(14723): 0.000000
12-16 11:39:33.252: I/IJKMEDIA(14723): , bitrate:
12-16 11:39:33.252: I/IJKMEDIA(14723): 26215 kb/s
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): Stream #0:0
12-16 11:39:33.252: I/IJKMEDIA(14723): (eng)
12-16 11:39:33.252: D/IJKMEDIA(14723): , 1, 1/90000
12-16 11:39:33.252: I/IJKMEDIA(14723): : Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuvj420p(pc, bt709, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 1001/120000, 25975 kb/s
12-16 11:39:33.252: I/IJKMEDIA(14723): ,
12-16 11:39:33.252: I/IJKMEDIA(14723): 59.96 fps,
12-16 11:39:33.252: I/IJKMEDIA(14723): 59.96 tbr,
12-16 11:39:33.252: I/IJKMEDIA(14723): 90k tbn,
12-16 11:39:33.252: I/IJKMEDIA(14723): 119.88 tbc
12-16 11:39:33.252: I/IJKMEDIA(14723): (default)
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): Metadata:
12-16 11:39:33.252: I/IJKMEDIA(14723): rotate :
12-16 11:39:33.252: I/IJKMEDIA(14723): 270
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): creation_time :
12-16 11:39:33.252: I/IJKMEDIA(14723): 2015-12-16 11:10:33
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): handler_name :
12-16 11:39:33.252: I/IJKMEDIA(14723): IMAGINE VISION .AVC
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): encoder :
12-16 11:39:33.252: I/IJKMEDIA(14723): Ambarella AVC encoder
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): Side data:
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): displaymatrix: rotation of 90.00 degrees
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): Stream #0:1
12-16 11:39:33.252: I/IJKMEDIA(14723): (eng)
12-16 11:39:33.252: D/IJKMEDIA(14723): , 2, 1/48000
12-16 11:39:33.252: I/IJKMEDIA(14723): : Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s
12-16 11:39:33.252: I/IJKMEDIA(14723): (default)
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): Metadata:
12-16 11:39:33.252: I/IJKMEDIA(14723): creation_time :
12-16 11:39:33.252: I/IJKMEDIA(14723): 2015-12-16 11:10:33
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.252: I/IJKMEDIA(14723): handler_name :
12-16 11:39:33.252: I/IJKMEDIA(14723): IMAGINE VISION AAC
12-16 11:39:33.252: I/IJKMEDIA(14723):
12-16 11:39:33.256: D/IJKMEDIA(14723): detected 3 logical cores
12-16 11:39:33.256: D/IJKMEDIA(14723): Setting 'sample_rate' to value '48000'
12-16 11:39:33.256: D/IJKMEDIA(14723): Setting 'sample_fmt' to value 'fltp'
12-16 11:39:33.256: D/IJKMEDIA(14723): Setting 'channels' to value '2'
12-16 11:39:33.256: D/IJKMEDIA(14723): Setting 'time_base' to value '1/48000'
12-16 11:39:33.256: D/IJKMEDIA(14723): Setting 'channel_layout' to value '0x3'
12-16 11:39:33.256: I/IJKMEDIA(14723): tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
12-16 11:39:33.256: I/IJKMEDIA(14723): auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'
12-16 11:39:33.256: D/IJKMEDIA(14723): query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
12-16 11:39:33.256: D/IJKMEDIA(14723): Using fltp internally between filters
12-16 11:39:33.256: I/IJKMEDIA(14723): ch:2 chl:stereo fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
12-16 11:39:33.257: I/IJKMEDIA(14723): SDL_Android_AudioTrack: CHANNEL_OUT_STEREO
12-16 11:39:33.257: I/IJKMEDIA(14723): SDL_Android_AudioTrack: ENCODING_PCM_16BIT
12-16 11:39:33.267: I/IJKMEDIA(14723): SDL_Android_AudioTrack_new: init volume as 1.000000/(0.000000,1.000000)
12-16 11:39:33.267: I/IJKMEDIA(14723): audio_session_id = 672
12-16 11:39:33.267: I/IJKMEDIA(14723): AudioCodec: avcodec, aac
12-16 11:39:33.267: I/IJKMEDIA(14723): SDL_RunThread: [14767] ff_aout_android
12-16 11:39:33.267: I/IJKMEDIA(14723): SDL_RunThread: [14768] ff_audio_dec
12-16 11:39:33.270: D/IJKMEDIA(14723): ffpipenode_create_video_decoder_from_android_mediacodec()
12-16 11:39:33.270: I/IJKMEDIA(14723): ffpipenode_create_video_decoder_from_android_mediacodec: MediaCodec: H264_HIGH: enabled
12-16 11:39:33.270: I/IJKMEDIA(14723): AMediaFormat: video/avc, 1920x1080
12-16 11:39:33.270: D/IJKMEDIA(14723): SDL_AMediaFormatJava_createVideoFormat
12-16 11:39:33.270: D/IJKMEDIA(14723): ASDK_ByteBuffer_allocateDirect
12-16 11:39:33.270: D/IJKMEDIA(14723): ASDK_ByteBuffer_limit
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 00000001
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 2764002a
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: ac34c807
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 80227e5c
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 05b80808
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 0a000007
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: d20003a9
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 81d0c000
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: c65c0000
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: c65d5779
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 71a18001
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 8cb80001
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 8cbaaef2
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: e1f08845
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 16000000
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 0128ee38
12-16 11:39:33.270: E/IJKMEDIA(14723): csd-0[65]: 30000000
12-16 11:39:33.270: I/IJKMEDIA(14723): amc: rotate notify: 270
12-16 11:39:33.270: D/IJKMEDIA(14723): ffpipeline_set_surface_need_reconfigure_l(0)
12-16 11:39:33.270: D/IJKMEDIA(14723): ffpipeline_select_mediacodec_l
12-16 11:39:33.270: D/IJKMEDIA(14723): FFP_MSG_VIDEO_ROTATION_CHANGED: 270
12-16 11:39:33.324: D/IJKMEDIA(14723): SDL_AMediaCodecJava_createByCodecName
12-16 11:39:33.331: D/IJKMEDIA(14723): SDL_AMediaCodecJava_init
12-16 11:39:33.331: D/IJKMEDIA(14723): SDL_AMediaCodecJava_configure_surface
12-16 11:39:33.331: E/IJKMEDIA(14723): configure acodec:0x10112e format:0x2010c2: surface:0x10111e
12-16 11:39:33.336: D/IJKMEDIA(14723): SDL_AMediaCodecJava_start
12-16 11:39:33.347: I/IJKMEDIA(14723): reconfigure_codec_l:new acodec: 0xf4bb8830
12-16 11:39:33.347: I/IJKMEDIA(14723): VideoCodec: MediaCodec, OMX.MTK.VIDEO.DECODER.AVC
12-16 11:39:33.347: W/IJKMEDIA(14723): fps: 59.960027 (too high)
12-16 11:39:33.347: W/IJKMEDIA(14723): fps: 59.960027 (too high)
12-16 11:39:33.347: I/IJKMEDIA(14723): SDL_RunThread: [14781] ff_video_dec
12-16 11:39:33.347: D/IJKMEDIA(14723): FFP_MSG_VIDEO_SIZE_CHANGED: 1920, 1080
12-16 11:39:33.347: D/IJKMEDIA(14723): FFP_MSG_SAR_CHANGED: 1, 1
12-16 11:39:33.347: D/IJKMEDIA(14723): ijkmp_get_msg: FFP_MSG_PREPARED
12-16 11:39:33.347: D/IJKMEDIA(14723): FFP_MSG_PREPARED:
12-16 11:39:33.348: I/IJKMEDIA(14723): SDL_RunThread: [14782] amediacodec_input_thread
12-16 11:39:33.376: D/IJKMEDIA(14723): IjkMediaPlayer_start
12-16 11:39:33.376: D/IJKMEDIA(14723): ijkmp_start()
12-16 11:39:33.376: D/IJKMEDIA(14723): ijkmp_start()=0
12-16 11:39:33.376: D/IJKMEDIA(14723): ijkmp_get_msg: FFP_REQ_START
12-16 11:39:33.376: D/IJKMEDIA(14723): ijkmp_get_msg: FFP_REQ_START: start on fly
12-16 11:39:33.447: D/IJKMEDIA(14723): ijkmp_get_msg: FFP_REQ_START
12-16 11:39:33.447: D/IJKMEDIA(14723): ijkmp_get_msg: FFP_REQ_START: start on fly
12-16 11:39:33.448: D/IJKMEDIA(14723): Audio frame changed from rate:48000 ch:2 fmt:fltp layout:stereo serial:-1 to rate:48000 ch:2 fmt:fltp layout:stereo serial:1
12-16 11:39:33.449: D/IJKMEDIA(14723): Setting 'sample_rate' to value '48000'
12-16 11:39:33.449: D/IJKMEDIA(14723): Setting 'sample_fmt' to value 'fltp'
12-16 11:39:33.449: D/IJKMEDIA(14723): Setting 'channels' to value '2'
12-16 11:39:33.449: D/IJKMEDIA(14723): Setting 'time_base' to value '1/48000'
12-16 11:39:33.449: D/IJKMEDIA(14723): Setting 'channel_layout' to value '0x3'
12-16 11:39:33.449: I/IJKMEDIA(14723): tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
12-16 11:39:33.449: I/IJKMEDIA(14723): auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'
12-16 11:39:33.449: D/IJKMEDIA(14723): query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
12-16 11:39:33.450: D/IJKMEDIA(14723): Using fltp internally between filters
12-16 11:39:33.450: I/IJKMEDIA(14723): ch:2 chl:stereo fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
12-16 11:39:33.450: D/IJKMEDIA(14723): avcodec/Audio: first frame decoded
12-16 11:39:33.450: D/IJKMEDIA(14723): FFP_MSG_AUDIO_RENDERING_START:
12-16 11:39:34.250: D/IJKMEDIA(14723): IjkMediaPlayer_setVideoSurface
12-16 11:39:34.250: D/IJKMEDIA(14723): ijkmp_set_android_surface(surface=0x0)
12-16 11:39:34.250: D/IJKMEDIA(14723): ffpipeline_set_surface()
12-16 11:39:34.250: D/IJKMEDIA(14723): ijkmp_set_android_surface(surface=0x0)=void
12-16 11:39:34.354: I/IJKMEDIA(14723): SDL_AMediaCodecJava_dequeueOutputBuffer: INFO_OUTPUT_BUFFERS_CHANGED
12-16 11:39:34.520: D/IJKMEDIA(14723): ijkmp_stop()
12-16 11:39:34.520: D/IJKMEDIA(14723): ijkmp_stop()=0
12-16 11:39:34.520: D/IJKMEDIA(14723): IjkMediaPlayer_release
12-16 11:39:34.520: D/IJKMEDIA(14723): ijkmp_set_android_surface(surface=0x0)
12-16 11:39:34.520: D/IJKMEDIA(14723): ffpipeline_set_surface()
12-16 11:39:34.520: D/IJKMEDIA(14723): ijkmp_set_android_surface(surface=0x0)=void
12-16 11:39:34.520: D/IJKMEDIA(14723): ijkmp_shutdown_l()
12-16 11:39:34.520: D/IJKMEDIA(14723): message_loop exit
12-16 11:39:34.520: D/IJKMEDIA(14723): wait for read_tid
12-16 11:39:34.520: I/IJKMEDIA(14723): SDL_JNI_DetachThreadEnv: [14758]
12-16 11:39:34.520: I/IJKMEDIA(14723): SDL_JNI_DetachThreadEnv: [14760]
12-16 11:39:34.524: I/IJKMEDIA(14723): SDL_JNI_DetachThreadEnv: [14768]
12-16 11:39:34.525: I/IJKMEDIA(14723): SDL_JNI_DetachThreadEnv: [14759]
12-16 11:39:34.563: I/IJKMEDIA(14723): SDL_JNI_DetachThreadEnv: [14767]
12-16 11:39:35.355: D/IJKMEDIA(14723): SDL_AMediaCodecJava_stop
12-16 11:39:35.355: D/IJKMEDIA(14723): ffpipeline_set_surface_need_reconfigure_l(0)
12-16 11:39:35.355: I/IJKMEDIA(14723): quirk: reconfigure with new codec
12-16 11:39:35.356: I/IJKMEDIA(14723): SDL_AMediaCodecJava_delete
12-16 11:39:35.417: D/IJKMEDIA(14723): SDL_AMediaCodecJava_createByCodecName
12-16 11:39:35.428: D/IJKMEDIA(14723): SDL_AMediaCodecJava_init
12-16 11:39:35.428: D/IJKMEDIA(14723): SDL_AMediaCodecJava_configure_surface
12-16 11:39:35.428: E/IJKMEDIA(14723): configure acodec:0x20111e format:0x2010c2: surface:0x0
12-16 11:39:35.434: D/IJKMEDIA(14723): SDL_AMediaCodecJava_start
12-16 11:39:35.465: I/IJKMEDIA(14723): reconfigure_codec_l:new acodec: 0xf4bb8830
12-16 11:39:35.465: I/IJKMEDIA(14723): MediaCodec: enqueue_thread_func: exit: 0
12-16 11:39:35.465: I/IJKMEDIA(14723): SDL_JNI_DetachThreadEnv: [14782]

@bbcallen
Copy link
Contributor

try master

@xiaoyaomeng
Copy link
Author

@bbcallen what's you mean?

@NikmanSergey
Copy link

@bbcallen,
I can confirm that with k0.4.4.1 after several playback starts app freezes very often with this log:

I/OMXClient? Using client-side OMX mux.
D/IJKMEDIA? SDL_AMediaCodecJava_init
D/IJKMEDIA? SDL_AMediaCodecJava_configure_surface
E/IJKMEDIA? configure acodec:0x200c06 format:0xc02: surface:0x0
D/MediaCodec? MediaCodec[kWhatConfigure]: video-output-protection: 00000000, audio-output-protection: 00000000
I/ExtendedCodec? Decoder will be in frame by frame mode
D/ACodec? Found video-output-protection flags set to 00000000
D/IJKMEDIA? SDL_AMediaCodecJava_start
I/IJKMEDIA? reconfigure_codec_l:new acodec: 0xaeedeab0
I/IJKMEDIA? MediaCodec: enqueue_thread_func: exit: 0
I/IJKMEDIA? SDL_JNI_DetachThreadEnv: [20442]
I/art? Thread[5,tid=25985,WaitingInMainSignalCatcherLoop,Thread*=0xb4829400,peer=0x32c070a0,"Signal Catcher"]: reacting to signal 3
I/art? [ 12-15 12:37:36.693   863:  884 I/Process  ]
    Sending signal. PID: 863 SIG: 3
I/art? Wrote stack traces to '/data/anr/traces.txt'

Also, I have seen this crash logs:

D/IJKMEDIA? FFP_MSG_VIDEO_SIZE_CHANGED: 1920, 1080
D/IJKMEDIA? SDL_VoutAMediaCodec_CreateOverlay(w=1920, h=1080, fmt=_AMC(0x434d415f, vout=0x95164ac0)
I/PlayerIjk? Detected video size 1920 x 1080
W/art? Suspending all threads took: 6.800ms
I/IJKMEDIA? SDL_AMediaCodecJava_dequeueOutputBuffer: INFO_OUTPUT_BUFFERS_CHANGED
I/IJKMEDIA? SDL_AMediaCodecJava_dequeueOutputBuffer: INFO_OUTPUT_FORMAT_CHANGED
I/IJKMEDIA? AMEDIACODEC__INFO_OUTPUT_FORMAT_CHANGED
D/IJKMEDIA? SDL_AMediaFormatJava_init
E/art? JNI ERROR (app bug): accessed deleted global reference 0x200b36
...
art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: native code passing in reference to invalid global reference: 0x200b36
A/art? art/runtime/check_jni.cc:65]     in call to DeleteGlobalRef
A/art? art/runtime/check_jni.cc:65] "Thread-2036" prio=5 tid=28 Runnable
...
art/runtime/check_jni.cc:65]   native: #07 pc 000b4c25  /system/lib/libart.so (art::CheckJNI::DeleteGlobalRef(_JNIEnv*, _jobject*)+68)
art/runtime/check_jni.cc:65]   native: #08 pc 0000d30f  /data/app/../lib/arm/libijksdl.so (SDL_JNI_DeleteGlobalRefP+14)
A/art? art/runtime/check_jni.cc:65]   native: #09 pc 0000e773  /data/app/.../lib/arm/libijksdl.so (???)
A/art? art/runtime/check_jni.cc:65]   native: #10 pc 0000f041  /data/app/.../lib/arm/libijksdl.so (SDL_AMediaCodec_getInputBuffer+4)
A/art? art/runtime/check_jni.cc:65]   native: #11 pc 000159f7  /data/app/.../lib/arm/libijkplayer.so (???)
A/art? art/runtime/check_jni.cc:65]   native: #12 pc 0000bbbf  /data/app/.../lib/arm/libijksdl.so (???)
A/art? art/runtime/check_jni.cc:65]   native: #13 pc 0001402b  /system/lib/libc.so (__pthread_start(void*)+30)
A/art? art/runtime/check_jni.cc:65]   native: #14 pc 00011f73  /system/lib/libc.so (__start_thread+6)
D/IJKMEDIA? SDL_AMediaFormatJava_init
I/IJKMEDIA? AMEDIACODEC__INFO_OUTPUT_FORMAT_CHANGED
    width-height: (1920 x 1088)
    color-format: (QCOM_FORMATYUV420PackedSemiPlanar32m: 0x7fa30c04)
    stride:       (1920)
    slice-height: (1088)
    crop:         (0, 0, 1919, 1079)
W/art? Suspending all threads took: 8.271ms
A/art? art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: jarray was NULL
A/art? art/runtime/check_jni.cc:65]     in call to GetObjectArrayElement
A/art? art/runtime/check_jni.cc:65] "Thread-2182" prio=5 tid=26 Runnable
...
A/art? art/runtime/check_jni.cc:65]   native: #07 pc 000bbb81  /system/lib/libart.so (art::CheckJNI::GetObjectArrayElement(_JNIEnv*, _jobjectArray*, int)+40)
A/art? art/runtime/check_jni.cc:65]   native: #08 pc 0000e7af  /data/app/.../lib/arm/libijksdl.so (???)
A/art? art/runtime/check_jni.cc:65]   native: #09 pc 0000f041  /data/app/.../lib/arm/libijksdl.so (SDL_AMediaCodec_getInputBuffer+4)
A/art? art/runtime/check_jni.cc:65]   native: #10 pc 000159f7  /data/app/.../lib/arm/libijkplayer.so (???)
A/art? art/runtime/check_jni.cc:65]   native: #11 pc 0000bbbf  /data/app/.../lib/arm/libijksdl.so (???)
A/art? art/runtime/check_jni.cc:65]   native: #12 pc 0001402b  /system/lib/libc.so (__pthread_start(void*)+30)
A/art? art/runtime/check_jni.cc:65]   native: #13 pc 00011f73  /system/lib/libc.so (__start_thread+6)
A/art? art/runtime/check_jni.cc:65]   (no managed stack frames)
A/art? art/runtime/check_jni.cc:65]
A/art? art/runtime/runtime.cc:295] Runtime aborting...

Please, help!

@NikmanSergey
Copy link

Crash log on another (ASUS tab) device:

D/IJKMEDIA﹕ IjkMediaPlayer_release
D/IJKMEDIA﹕ ijkmp_set_android_surface(surface=0x0)
D/IJKMEDIA﹕ ffpipeline_set_surface()
D/IJKMEDIA﹕ ijkmp_set_android_surface(surface=0x0)=void
D/IJKMEDIA﹕ ijkmp_shutdown_l()
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25073]
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25045]
E/ACodec﹕ dequeueBuffer failed: No such device (19)
E/ACodec﹕ Failed to allocate output port buffers after port reconfiguration (error 0xffffffed)
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25072]
E/MediaCodec﹕ Codec reported an error. (omx error 0x80001001, internalError -19)
A/MediaCodec﹕ frameworks/av/media/libstagefright/MediaCodec.cpp:745 CHECK_EQ( mState,RELEASING) failed: 6 vs. 9
W/System.err﹕ java.lang.IllegalStateException
W/System.err﹕ at android.media.MediaCodec.dequeueOutputBuffer(Native Method)
W/System.err﹕ at dalvik.system.NativeStart.run(Native Method)
I/IJKMEDIA﹕ SDL_AMediaCodecJava_dequeueOutputBuffer: Exception
W/System.err﹕ java.lang.IllegalStateException
W/System.err﹕ at android.media.MediaCodec.dequeueInputBuffer(Native Method)
W/System.err﹕ at dalvik.system.NativeStart.run(Native Method)
E/IJKMEDIA﹕ SDL_AMediaCodecJava_dequeueInputBuffer: dequeueInputBuffer failed
I/IJKMEDIA﹕ MediaCodec: enqueue_thread_func: exit: 0
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25095]
D/IJKMEDIA﹕ SDL_AMediaCodecJava_stop
A/libc﹕ Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 25089 (MediaCodec_loop)

@bbcallen
Copy link
Contributor

Can't reproduce on master, how did you reproduce that?

@bbcallen
Copy link
Contributor

@NikmanSergey. Does it happen before #702 ?.

@NikmanSergey
Copy link

Just play many times one FullHD video with MediaCodec=1.
On Sony Z3 after ~10 starts. On ASUS tab on frequent playback starts.
However, I do not see this issue on MINIX X8-H tv-box.

@NikmanSergey
Copy link

@bbcallen,
I saw freezes and crashes along with #702 issue. But not saved exact crash logs.

@bbcallen
Copy link
Contributor

@xiaoyaomeng try latest code on master.

@NikmanSergey
Copy link

I tried it with latest code (without last 2 commits 73d7675 and 2c4b229)

@bbcallen
Copy link
Contributor

Can you locate the exact crash line number with addr2line?

@NikmanSergey
Copy link

Seems, that before fixing this issue #702 there is no such problem...

@NikmanSergey
Copy link

Where can I get line number? In '/data/anr/traces.txt'?

The app freezes at line:

I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [5343]

@bbcallen
Copy link
Contributor

use addr2line

@NikmanSergey
Copy link

Sorry... I can reproduce this issue in ijk-sample app, when using library compiled before #702 fixing commit.

@bbcallen
Copy link
Contributor

I have pushed a blind fix 071724c
Not sure if it can reduce occurrence of this issue.

@NikmanSergey
Copy link

It's not crash, but hangup... you can force to stop the app which is not responding. I see in traces.txt:

  native: #00 pc 000104e8  /system/lib/libc.so (syscall+28)
  native: #01 pc 0001460b  /system/lib/libc.so (pthread_join+90)
  native: #02 pc 0000bca9  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijksdl.so (SDL_WaitThread+12)
  native: #03 pc 0000a123  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijkplayer.so (???)
  native: #04 pc 0000a20f  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijkplayer.so (???)
  native: #05 pc 0000d9a3  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijkplayer.so (ffp_wait_stop_l+14)
  native: #06 pc 00011d79  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijkplayer.so (ijkmp_shutdown_l+28)
  native: #07 pc 00014a7d  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijkplayer.so (???)
  native: #08 pc 001dd1e7  /data/dalvik-cache/arm/data@[email protected][email protected]@classes.dex (Java_tv_danmaku_ijk_media_player_IjkMediaPlayer__1release__+82)
  at tv.danmaku.ijk.media.player.IjkMediaPlayer._release(Native method) 

Should I check the real number of this line?

native: #02 pc 0000bca9  /data/app/tv.danmaku.ijk_sample-2/lib/arm/libijksdl.so (SDL_WaitThread+12)

@bbcallen,
Thanks! I'll try it.

@NikmanSergey
Copy link

Tested this issue with k0.4.1.1 on Sony Z3. Also, have app freeze after ~10 videos playback:

D/IJKMEDIA? SDL_AMediaCodecJava_configure_surface
E/IJKMEDIA? configure 0x200bd6 0xb42
D/MediaCodec? MediaCodec[kWhatConfigure]: video-output-protection: 00000000, audio-output-protection: 00000000
I/ExtendedCodec? Decoder will be in frame by frame mode
D/ACodec? Found video-output-protection flags set to 00000000
D/IJKMEDIA? SDL_AMediaCodecJava_start
I/IJKMEDIA? MediaCodec: enqueue_thread_func: exit: 0
W/art? Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[25,tid=28851,Native,Thread*=0x97c40400,peer=0x12c0e7c0,"Thread-10706"]
I/art? Thread[5,tid=26817,WaitingInMainSignalCatcherLoop,Thread*=0xb4828c00,peer=0x12c000a0,"Signal Catcher"]: reacting to signal 3
I/art? [ 12-16 15:13:24.572   864:  885 I/Process  ]
    Sending signal. PID: 864 SIG: 3
I/art? Wrote stack traces to '/data/anr/traces.txt'

@NikmanSergey
Copy link

@bbcallen,
Commit did not help :(

D/IJKMEDIA: ijkmp_stop()
D/IJKMEDIA: ijkmp_stop()=0
D/IJKMEDIA: IjkMediaPlayer_reset
D/IJKMEDIA: IjkMediaPlayer_release
D/IJKMEDIA: ijkmp_shutdown_l()
D/IJKMEDIA: message_loop exit
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [12868]
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [12869]
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [12870]
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [12892]
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [12889]
D/IJKMEDIA: SDL_AMediaCodecJava_stop
I/IJKMEDIA: quirk: reconfigure with new codec
D/IJKMEDIA: SDL_AMediaCodec_decreaseReference(): ref=0
I/IJKMEDIA: SDL_AMediaCodecJava_delete
D/IJKMEDIA: SDL_AMediaCodecJava_createByCodecName
I/OMXClient: Using client-side OMX mux.
D/IJKMEDIA: SDL_AMediaCodecJava_init
D/IJKMEDIA: SDL_AMediaCodec_increaseReference(): ref=1
D/IJKMEDIA: SDL_AMediaCodecJava_configure_surface
E/IJKMEDIA: configure acodec:0x100dce format:0x100d12: surface:0x0
D/MediaCodec: MediaCodec[kWhatConfigure]: video-output-protection: 00000000, audio-output-protection: 00000000
I/ExtendedCodec: Decoder will be in frame by frame mode
D/ACodec: Found video-output-protection flags set to 00000000
D/IJKMEDIA: SDL_AMediaCodecJava_start
I/IJKMEDIA: reconfigure_codec_l:new acodec: 0xa0c36290
D/IJKMEDIA: SDL_AMediaCodec_increaseReference(): ref=2
I/IJKMEDIA: MediaCodec: enqueue_thread_func: exit: 0
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [12908]

How can I help to find it?

@bbcallen
Copy link
Contributor

Actually, I need some devices to reproduce this issue.
I can't reproduce this problem on my Nexus 6p after this commit.

I'm going to do more test in following weeks.

@Android4MediaPlayer
Copy link

特定机型才出现吗?还是跟文件有关系?提供详细背景

@NikmanSergey
Copy link

@bbcallen,
Let me know, if I can help to make tests on my devices.

@xiaoyaomeng
Copy link
Author

@bbcallen @NikmanSergey
我的卡住的问题应该跟他的是一样的,我换成Nexus 5就提示了ANR了。
附上traces.txt中一部分文本
DALVIK THREADS (28):
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x7448b000 self=0xb4827800
| sysTid=8835 nice=0 cgrp=default sched=0/0 handle=0xb6f50bec
| state=S schedstat=( 8186289065 5705899102 19327 ) utm=695 stm=123 core=0 HZ=100
| stack=0xbe64d000-0xbe64f000 stackSize=8MB
| held mutexes=
kernel: (couldn't read /proc/self/task/8835/stack)
native: #00 pc 000133b8 /system/lib/libc.so (syscall+28)
native: #1 pc 0001712b /system/lib/libc.so (pthread_join+90)
native: #2 pc 000091b9 /data/app/com.xinxin.video-1/lib/arm/libijksdl.so (SDL_WaitThread+12)
native: #3 pc 00009a6b /data/app/com.xinxin.video-1/lib/arm/libijkplayer.so (???)
native: #4 pc 00009b57 /data/app/com.xinxin.video-1/lib/arm/libijkplayer.so (???)
native: #5 pc 0000d2eb /data/app/com.xinxin.video-1/lib/arm/libijkplayer.so (ffp_wait_stop_l+14)
native: #6 pc 000114f9 /data/app/com.xinxin.video-1/lib/arm/libijkplayer.so (ijkmp_shutdown_l+28)
native: #7 pc 0001403b /data/app/com.xinxin.video-1/lib/arm/libijkplayer.so (???)
native: #8 pc 001e9be7 /data/dalvik-cache/arm/data@[email protected]@[email protected] (Java_tv_danmaku_ijk_media_player_IjkMediaPlayer__1release__+82)
at tv.danmaku.ijk.media.player.IjkMediaPlayer._release(Native method)
at tv.danmaku.ijk.media.player.IjkMediaPlayer.release(IjkMediaPlayer.java:611)
at com.xinxin.video.ijkplayer.IjkVideoView.stopPlayback(IjkVideoView.java:302)
at com.xinxin.video.PlaybackVideoActivity.onStop(PlaybackVideoActivity.java:126)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1277)
at android.app.Activity.performStop(Activity.java:6142)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3665)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3724)
at android.app.ActivityThread.access$1400(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke!(Native method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

"Heap thread pool worker thread 0" prio=5 tid=2 Native (still starting up)
| group="" sCount=1 dsCount=0 obj=0x0 self=0xaec3f400
| sysTid=8840 nice=0 cgrp=default sched=0/0 handle=0xb4918080
| state=S schedstat=( 2279689 96926 13 ) utm=0 stm=0 core=0 HZ=100
| stack=0xb4183000-0xb4185000 stackSize=1020KB
| held mutexes=
kernel: (couldn't read /proc/self/task/8840/stack)
native: #00 pc 000133b8 /system/lib/libc.so (syscall+28)
native: #1 pc 000a9fe3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread_)+98)
native: #2 pc 00243965 /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread_)+64)
native: #3 pc 002438ff /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
native: #4 pc 002441ed /system/lib/libart.so (art::ThreadPoolWorker::Callback(void_)+60)
native: #5 pc 00016baf /system/lib/libc.so (_pthread_start(void)+30)
native: #6 pc 00014af3 /system/lib/libc.so (__start_thread+6)
(no managed stack frames)

"Heap thread pool worker thread 1" prio=5 tid=3 Native (still starting up)
| group="" sCount=1 dsCount=0 obj=0x0 self=0xb4827c00
| sysTid=8842 nice=0 cgrp=default sched=0/0 handle=0xb4918300
| state=S schedstat=( 1330626 5591927 13 ) utm=0 stm=0 core=1 HZ=100
| stack=0xb4081000-0xb4083000 stackSize=1020KB
| held mutexes=
kernel: (couldn't read /proc/self/task/8842/stack)
native: #00 pc 000133b8 /system/lib/libc.so (syscall+28)
native: #1 pc 000a9fe3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread_)+98)
native: #2 pc 00243965 /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread_)+64)
native: #3 pc 002438ff /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
native: #4 pc 002441ed /system/lib/libart.so (art::ThreadPoolWorker::Callback(void_)+60)
native: #5 pc 00016baf /system/lib/libc.so (_pthread_start(void)+30)
native: #6 pc 00014af3 /system/lib/libc.so (__start_thread+6)
(no managed stack frames)

"Heap thread pool worker thread 2" prio=5 tid=4 Native (still starting up)
| group="" sCount=1 dsCount=0 obj=0x0 self=0xaec40400
| sysTid=8843 nice=0 cgrp=default sched=0/0 handle=0xb4918580
| state=S schedstat=( 1354790 1665992 11 ) utm=0 stm=0 core=1 HZ=100
| stack=0xb3f81000-0xb3f83000 stackSize=1020KB
| held mutexes=
kernel: (couldn't read /proc/self/task/8843/stack)
native: #00 pc 000133b8 /system/lib/libc.so (syscall+28)
native: #1 pc 000a9fe3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread_)+98)
native: #2 pc 00243965 /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread_)+64)
native: #3 pc 002438ff /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
native: #4 pc 002441ed /system/lib/libart.so (art::ThreadPoolWorker::Callback(void_)+60)
native: #5 pc 00016baf /system/lib/libc.so (_pthread_start(void)+30)
native: #6 pc 00014af3 /system/lib/libc.so (__start_thread+6)
(no managed stack frames)

"Signal Catcher" daemon prio=5 tid=5 Runnable
| group="system" sCount=0 dsCount=0 obj=0x32c070a0 self=0xb4a34000
| sysTid=8844 nice=0 cgrp=default sched=0/0 handle=0xb4918800
| state=R schedstat=( 60993325 4351358 108 ) utm=2 stm=4 core=0 HZ=100
| stack=0xb3e79000-0xb3e7b000 stackSize=1012KB
| held mutexes= "thread list lock" "mutator lock"(exclusive held)
native: #00 pc 00004e64 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext_)+23)
native: #1 pc 00003665 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext_)+8)
native: #2 pc 00256429 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::1::char_traits >&, int, char const, art::mirror::ArtMethod)+84)
native: #3 pc 00238fe7 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&) const+158)
native: #4 pc 002428fd /system/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits >&)+160)
native: #5 pc 00228d5d /system/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::_1::char_traits >&)+76)
native: #6 pc 0022d7bb /system/lib/libart.so (art::SignalCatcher::HandleSigQuit()+782)
native: #7 pc 0022dea3 /system/lib/libart.so (art::SignalCatcher::Run(void
)+338)
native: #8 pc 00016baf /system/lib/libc.so (_pthread_start(void)+30)
native: #9 pc 00014af3 /system/lib/libc.so (__start_thread+6)
(no managed stack frames)

@xiaoyaomeng
Copy link
Author

@bbcallen
12-17 16:06:05.192: I/PlaybackVideoActivity(25629): onStop ---------- begin
12-17 16:06:05.874: I/PlaybackVideoActivity(25629): onStop ---------- end
12-17 16:06:05.874: I/PlaybackVideoActivity(25629): onDestroy ---------- begin
12-17 16:06:05.874: I/PlaybackVideoActivity(25629): onDestroy ---------- end
12-17 16:06:09.816: I/PlaybackVideoActivity(25629): PlaybackVideoActivity onResume
12-17 16:06:52.620: I/PlaybackVideoActivity(25629): PlaybackVideoActivity onPause
12-17 16:06:53.124: I/PlaybackVideoActivity(25629): onStop ---------- begin
几次之后就卡住了。看log大概可以判断是以下几行代码太耗时导致的,感觉直接把这几行代码放在线程中似乎也不好。

mVideoView.stopPlayback();
mVideoView.release(true);
mVideoView.stopBackgroundPlay();

@bbcallen
Copy link
Contributor

Try this branch cab87a3

@NikmanSergey
Copy link

D/IJKMEDIA﹕ SDL_AMediaCodecJava_stop
I/IJKMEDIA﹕ quirk: reconfigure with new codec
D/IJKMEDIA﹕ SDL_AMediaCodec_decreaseReference(): ref=0
I/IJKMEDIA﹕ SDL_AMediaCodecJava_delete
I/IJKMEDIA﹕ SDL_AMediaCodecDummy_create
D/IJKMEDIA﹕ SDL_AMediaCodec_increaseReference(): ref=1
I/IJKMEDIA﹕ reconfigure_codec_l:new acodec: 0x95c882e0
D/IJKMEDIA﹕ SDL_AMediaCodec_increaseReference(): ref=2
I/IJKMEDIA﹕ MediaCodec: enqueue_thread_func: exit: 0
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [21532]
I/art﹕ Thread[5,tid=18795,WaitingInMainSignalCatcherLoop,Thread*=0xb4828800,peer=0x12c000a0,"Signal Catcher"]: reacting to signal 3
I/art﹕ [ 12-17 13:28:25.543  1456: 1456 D/StatusBar.NetworkController ]
    hasService: mServiceState=0 0 voice home data home MTS RUS MTS RUS 25001 MTS RUS MTS RUS 25001  GSM EDGE CSS supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=false retVal=true
I/art﹕ Wrote stack traces to '/data/anr/traces.txt'

@NikmanSergey
Copy link

Another freeze log:

D/IJKMEDIA﹕ ijkmp_stop()
D/IJKMEDIA﹕ message_loop exit
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25643]
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25644]
D/IJKMEDIA﹕ ijkmp_stop()=0
D/IJKMEDIA﹕ IjkMediaPlayer_reset
D/IJKMEDIA﹕ IjkMediaPlayer_release
D/IJKMEDIA﹕ ijkmp_shutdown_l()
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25645]
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25668]
I/IJKMEDIA﹕ quirk: reconfigure with new codec
D/IJKMEDIA﹕ SDL_AMediaCodec_decreaseReference(): ref=0
I/IJKMEDIA﹕ SDL_AMediaCodecJava_delete
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25667]
W/IJKMEDIA﹕ SDL_VoutAndroid_releaseBufferProxy_l: [0] ???????? proxy 0: vout: 0 idx: -1 render: false fake: NO
D/IJKMEDIA﹕ SDL_AMediaCodecJava_stop
W/ALooperRoster﹕ failed to deliver message. Target handler 14 registered, but object gone.
I/IJKMEDIA﹕ SDL_AMediaCodecDummy_create
D/IJKMEDIA﹕ SDL_AMediaCodec_increaseReference(): ref=1
I/IJKMEDIA﹕ reconfigure_codec_l:new acodec: 0xa0d87f60
D/IJKMEDIA﹕ SDL_AMediaCodec_increaseReference(): ref=2
I/IJKMEDIA﹕ MediaCodec: enqueue_thread_func: exit: 0
I/IJKMEDIA﹕ SDL_JNI_DetachThreadEnv: [25681]

@Android4MediaPlayer
Copy link

plz try master

@NikmanSergey
Copy link

@Android4MediaPlayer, latest master still has this issue

@Android4MediaPlayer
Copy link

which device?

@NikmanSergey
Copy link

@bbcallen,
The last was my fault.
I was doing surface recreate just before mediaPlayer.reset(). When I put it after - this problem disappeared.
Last master works more stable now! Thanks!

@bbcallen
Copy link
Contributor

@NikmanSergey
Good to hear that.
Feel free to reopen this issue, if same issue appear again.

@xiaoyaomeng
Copy link
Author

@bbcallen 我们这边现在还是会出现这个问题,demo不会出现,播放的是本地视频,我们这边出现了,是播放在线视频。不知道这个是否有区别。

@xiaoyaomeng
Copy link
Author

@bbcallen 请问我需要提供哪些Log给您?

我在onStop里面加了一些Log,还是在onStop里面卡住

12-21 14:24:43.867: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:25:01.763: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:25:02.198: I/PlaybackVideoActivity(15684): onstop begin----------
12-21 14:25:02.867: I/PlaybackVideoActivity(15684): onstop end----------
12-21 14:25:02.933: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:25:03.664: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:25:04.091: I/PlaybackVideoActivity(15684): onstop begin----------
12-21 14:25:04.182: I/PlaybackVideoActivity(15684): onstop end----------
12-21 14:25:10.119: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:25:18.397: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:25:18.819: I/PlaybackVideoActivity(15684): onstop begin----------
12-21 14:25:19.874: I/PlaybackVideoActivity(15684): onstop end----------
12-21 14:25:19.955: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:25:21.123: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:25:21.554: I/PlaybackVideoActivity(15684): onstop begin----------
12-21 14:25:22.237: I/PlaybackVideoActivity(15684): onstop end----------
12-21 14:25:22.307: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:25:23.200: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:25:23.629: I/PlaybackVideoActivity(15684): onstop begin----------
12-21 14:25:24.576: I/PlaybackVideoActivity(15684): onstop end----------
12-21 14:25:24.643: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:25:25.417: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:25:25.806: I/PlaybackVideoActivity(15684): onstop begin----------
12-21 14:25:26.802: I/PlaybackVideoActivity(15684): onstop end----------
12-21 14:25:26.873: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onResume
12-21 14:26:11.656: I/PlaybackVideoActivity(15684): PlaybackVideoActivity onPause
12-21 14:26:12.065: I/PlaybackVideoActivity(15684): onstop begin----------
//这里没有再打出 onstop end 了。

onStop()里:

protected void onStop() {
Logger.i(TAG, "onstop begin----------");
super.onStop();
mCurrentPos = mVideoView.getCurrentPosition();
mVideoView.stopPlayback();
mVideoView.release(true);
mVideoView.stopBackgroundPlay();
IjkMediaPlayer.native_profileEnd();
Logger.i(TAG, "onstop end----------");
}

@xiaoyaomeng
Copy link
Author

@NikmanSergey 你的问题解决了??有试过在线的视频吗?

@xiaoyaomeng
Copy link
Author

@Android4MediaPlayer 请问您清楚这个问题吗?现在项目比较急

@Android4MediaPlayer
Copy link

demo没有问题,那是你调用的问题,查查这方面

@xiaoyaomeng
Copy link
Author

@Android4MediaPlayer 不明白,为什么是调用的问题?onStop里面的写法就是sample-demo里面的写法。不过demo里播放的是本地视频,我这边的列表都是在线视频。

@Android4MediaPlayer
Copy link

对比测试下

@xiaoyaomeng
Copy link
Author

@bbcallen @Android4MediaPlayer 我打了下log发现卡在这个函数mVideoView.stopPlayback();

12-21 15:50:43.800: D/IJKMEDIA(7219): ijkmp_stop()
12-21 15:50:43.800: D/IJKMEDIA(7219): ijkmp_stop()=0
12-21 15:50:43.800: D/IJKMEDIA(7219): IjkMediaPlayer_release
12-21 15:50:43.800: D/IJKMEDIA(7219): ijkmp_shutdown_l()
12-21 15:50:43.800: D/IJKMEDIA(7219): wait for read_tid
12-21 15:50:43.800: D/IJKMEDIA(7219): message_loop exit
12-21 15:50:43.800: I/IJKMEDIA(7219): SDL_JNI_DetachThreadEnv: [7907]
12-21 15:50:43.801: I/IJKMEDIA(7219): SDL_JNI_DetachThreadEnv: [7909]
12-21 15:50:43.801: I/IJKMEDIA(7219): SDL_JNI_DetachThreadEnv: [7927]
12-21 15:50:43.803: I/IJKMEDIA(7219): SDL_JNI_DetachThreadEnv: [7926]
12-21 15:50:43.808: I/IJKMEDIA(7219): SDL_JNI_DetachThreadEnv: [7908]
12-21 15:50:44.426: D/IJKMEDIA(7219): SDL_AMediaCodecJava_stop
12-21 15:50:44.426: I/IJKMEDIA(7219): quirk: reconfigure with new codec
12-21 15:50:44.426: D/IJKMEDIA(7219): SDL_AMediaCodec_decreaseReference(): ref=0
12-21 15:50:44.426: I/IJKMEDIA(7219): SDL_AMediaCodecJava_delete
12-21 15:50:44.552: D/IJKMEDIA(7219): SDL_AMediaCodecJava_createByCodecName
12-21 15:50:44.565: D/IJKMEDIA(7219): SDL_AMediaCodecJava_init
12-21 15:50:44.565: D/IJKMEDIA(7219): SDL_AMediaCodec_increaseReference(): ref=1
12-21 15:50:44.565: D/IJKMEDIA(7219): SDL_AMediaCodecJava_configure_surface
12-21 15:50:44.565: E/IJKMEDIA(7219): configure acodec:0x101372 format:0x20136a: surface:0x0
12-21 15:50:44.570: D/IJKMEDIA(7219): SDL_AMediaCodecJava_start
12-21 15:50:44.650: I/IJKMEDIA(7219): reconfigure_codec_l:new acodec: 0xdc41aba0
12-21 15:50:44.650: D/IJKMEDIA(7219): SDL_AMediaCodec_increaseReference(): ref=2
12-21 15:50:44.650: I/IJKMEDIA(7219): MediaCodec: enqueue_thread_func: exit: 0
12-21 15:50:44.650: I/IJKMEDIA(7219): SDL_JNI_DetachThreadEnv: [7940]
12-21 15:51:23.299: D/IJKMEDIA(7219): IjkMediaPlayer_native_finalize
12-21 15:51:23.299: D/IJKMEDIA(7219): IjkMediaPlayer_release

@NikmanSergey
Copy link

@xiaoyaomeng,
Sorry, I don't undersand Chinese.
Do you have this problem only when using local files or online streams?

@xiaoyaomeng
Copy link
Author

Only when using online streams

@xiaoyaomeng
Copy link
Author

@NikmanSergey Only when using online streams, I press back button,when player activity call onStop() , UI Thread was blocked. Sorry for my poor english.
I know the reason can be the mVideoView.stopPlayback() method called.

@xiaoyaomeng
Copy link
Author

@bbcallen 再补充一点信息,我在Nexus 5上验证这个问题。
DALVIK THREADS (29):
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x7448b000 self=0xb4827800
| sysTid=13188 nice=0 cgrp=default sched=0/0 handle=0xb6f37bec
| state=S schedstat=( 26214283086 21124144964 72800 ) utm=2133 stm=488 core=3 HZ=100
| stack=0xbe5fd000-0xbe5ff000 stackSize=8MB
| held mutexes=
kernel: (couldn't read /proc/self/task/13188/stack)
native: #00 pc 000133b8 /system/lib/libc.so (syscall+28)
native: #1 pc 0001712b /system/lib/libc.so (pthread_join+90)
native: #2 pc 0000bcad /data/app/com.sm.smartcamera-1/lib/arm/libijksdl.so (SDL_WaitThread+12)
native: #3 pc 00009df3 /data/app/com.sm.smartcamera-1/lib/arm/libijkplayer.so (???)
native: #4 pc 00009edf /data/app/com.sm.smartcamera-1/lib/arm/libijkplayer.so (???)
native: #5 pc 0000d2f3 /data/app/com.sm.smartcamera-1/lib/arm/libijkplayer.so (ffp_wait_stop_l+14)
native: #6 pc 0001181d /data/app/com.sm.smartcamera-1/lib/arm/libijkplayer.so (ijkmp_shutdown_l+28)
native: #7 pc 0001453b /data/app/com.sm.smartcamera-1/lib/arm/libijkplayer.so (???)
native: #8 pc 001ea45f /data/dalvik-cache/arm/data@[email protected]@[email protected] (Java_tv_danmaku_ijk_media_player_IjkMediaPlayer__1release__+82)
at tv.danmaku.ijk.media.player.IjkMediaPlayer._release(Native method)
at tv.danmaku.ijk.media.player.IjkMediaPlayer.release(IjkMediaPlayer.java:666)
at com.sm.smartcamera.ijkplayer.IjkVideoView.stopPlayback(IjkVideoView.java:327)
at com.sm.smartcamera.PlaybackVideoActivity.onStop(PlaybackVideoActivity.java:129)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1277)
at android.app.Activity.performStop(Activity.java:6142)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3665)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3724)
at android.app.ActivityThread.access$1400(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke!(Native method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

@zourb
Copy link

zourb commented Jan 22, 2016

I have the same problem with @xiaoyaomeng , my LENOVO YOGA TABLET2 was sometimes freezed when mVideoView.stopPlayback() be called by onStop() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants