Example #1
0
int player_mate_sleep(play_para_t *player)
{
    struct player_mate *mate = (struct player_mate *)(player->player_mate);
    int ret = 0;
    if (!mate) {
        return -1;
    }
    while (mate->mate_isrunng) {
        pthread_mutex_lock(&mate->pthread_mutex);
        mate->mate_should_sleep = 1;
        ret = pthread_cond_signal(&mate->pthread_cond);
        pthread_mutex_unlock(&mate->pthread_mutex);
        if (mate->mate_isrunng) {
            player_thread_wait(player, 1000);
        }
    }
    return ret;
}
Example #2
0
int player_mate_sleep(play_para_t *player)
{
    struct player_mate *mate = (struct player_mate *)(player->player_mate);
    int ret = 0;
    if (!mate) {
        return -1;
    }
    if(player->playctrl_info.temp_interrupt_ffmpeg){
	     player->playctrl_info.temp_interrupt_ffmpeg=0;	
	     log_print("ffmpeg_uninterrupt tmped by player mate!\n");	 
         ffmpeg_uninterrupt_light(player->thread_mgt.pthread_id);
    }
    mate->mate_should_sleep = 1;	 
    while (mate->mate_isrunng) {
        pthread_mutex_lock(&mate->pthread_mutex);
        ret = pthread_cond_signal(&mate->pthread_cond);
        pthread_mutex_unlock(&mate->pthread_mutex);
        if (mate->mate_isrunng) {
            player_thread_wait(player, 1000);
        }
    }
    return ret;
}