{"action":"created","issue":{"url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/988","repository_url":"https://api.github.com/repos/Bilibili/ijkplayer","labels_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/988/labels{/name}","comments_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/988/comments","events_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/988/events","html_url":"https://github.com/Bilibili/ijkplayer/issues/988","id":138402672,"number":988,"title":"prepareAsync never callback","user":{"login":"kengabc","id":4427224,"avatar_url":"https://avatars.githubusercontent.com/u/4427224?v=3","gravatar_id":"","url":"https://api.github.com/users/kengabc","html_url":"https://github.com/kengabc","followers_url":"https://api.github.com/users/kengabc/followers","following_url":"https://api.github.com/users/kengabc/following{/other_user}","gists_url":"https://api.github.com/users/kengabc/gists{/gist_id}","starred_url":"https://api.github.com/users/kengabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kengabc/subscriptions","organizations_url":"https://api.github.com/users/kengabc/orgs","repos_url":"https://api.github.com/users/kengabc/repos","events_url":"https://api.github.com/users/kengabc/events{/privacy}","received_events_url":"https://api.github.com/users/kengabc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Bilibili/ijkplayer/labels/need-more-information","name":"need-more-information","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-04T07:28:39Z","updated_at":"2016-03-04T08:08:22Z","closed_at":null,"body":"Hi, I try to play a video from network, after call the IJKMediaPlayer.prepareAsync(), the onPrepared never called. \r\n\r\nthe log as follows:\r\n\r\nijkplayer_log IjkMediaPlayer_prepareAsync\r\nijkplayer_log ijkmp_prepare_async()\r\nijkplayer_log ===== versions =====\r\nijkplayer_log FFmpeg       : ff2.8--ijk0.4.1.1--dev0.3.3--rc4\r\nijkplayer_log FFP_MSG_FLUSH:\r\nijkplayer_log libavutil    : 54.31.100\r\nijkplayer_log libavcodec   : 56.60.100\r\nijkplayer_log libavformat  : 56.40.101\r\nijkplayer_log libswscale   : 3.1.101\r\nijkplayer_log libswresample: 1.2.101\r\nijkplayer_log ===== options =====\r\nijkplayer_log player-opts : loop                         = 1\r\nijkplayer_log format-opts : ijkinject-opaque             = 490735014\r\nijkplayer_log ===================\r\nijkplayer_log ijkmp_prepare_async()=0"},"comment":{"url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/comments/192174784","html_url":"https://github.com/Bilibili/ijkplayer/issues/988#issuecomment-192174784","issue_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/988","id":192174784,"user":{"login":"kengabc","id":4427224,"avatar_url":"https://avatars.githubusercontent.com/u/4427224?v=3","gravatar_id":"","url":"https://api.github.com/users/kengabc","html_url":"https://github.com/kengabc","followers_url":"https://api.github.com/users/kengabc/followers","following_url":"https://api.github.com/users/kengabc/following{/other_user}","gists_url":"https://api.github.com/users/kengabc/gists{/gist_id}","starred_url":"https://api.github.com/users/kengabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kengabc/subscriptions","organizations_url":"https://api.github.com/users/kengabc/orgs","repos_url":"https://api.github.com/users/kengabc/repos","events_url":"https://api.github.com/users/kengabc/events{/privacy}","received_events_url":"https://api.github.com/users/kengabc/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T08:08:22Z","updated_at":"2016-03-04T08:08:22Z","body":"It seems hangs in \r\n mp->msg_thread = SDL_CreateThreadEx(&mp->_msg_thread, ijkmp_msg_loop, mp, \"ff_msg_loop\");\r\n\r\n**as in the Method of ijkmp_prepare_async_l(IjkMediaPlayer *mp) of ijkplayer.c:**\r\n\r\nstatic int ijkmp_prepare_async_l(IjkMediaPlayer *mp)\r\n{\r\n    assert(mp);\r\n\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_IDLE);\r\n    // MPST_RET_IF_EQ(mp->mp_state, MP_STATE_INITIALIZED);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_ASYNC_PREPARING);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_PREPARED);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_STARTED);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_PAUSED);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_COMPLETED);\r\n    // MPST_RET_IF_EQ(mp->mp_state, MP_STATE_STOPPED);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_ERROR);\r\n    MPST_RET_IF_EQ(mp->mp_state, MP_STATE_END);\r\n\r\n    assert(mp->data_source);\r\n\r\n    ijkmp_change_state_l(mp, MP_STATE_ASYNC_PREPARING);\r\n\r\n    msg_queue_start(&mp->ffplayer->msg_queue);\r\n\r\n    // released in msg_loop\r\n    ijkmp_inc_ref(mp);\r\n    mp->msg_thread = SDL_CreateThreadEx(&mp->_msg_thread, ijkmp_msg_loop, mp, \"ff_msg_loop\");\r\n    // msg_thread is detached inside msg_loop\r\n    // TODO: 9 release weak_thiz if pthread_create() failed;\r\n\r\n    int retval = ffp_prepare_async_l(mp->ffplayer, mp->data_source);\r\n    if (retval < 0) {\r\n        ijkmp_change_state_l(mp, MP_STATE_ERROR);\r\n        return retval;\r\n    }\r\n\r\n    return 0;\r\n}\r\n"}}