void tuxtxt_start(int tpid) { if (tuxtxt_cache.vtxtpid != tpid) { tuxtxt_stop(); tuxtxt_clear_cache(); tuxtxt_cache.page = 0x100; tuxtxt_cache.vtxtpid = tpid; tuxtxt_start_thread(); } else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving) { tuxtxt_start_thread(); } }
int tuxtxt_start(int tpid) { int ret = 1; pthread_mutex_lock(&tuxtxt_control_lock); if (tuxtxt_cache.vtxtpid != tpid) { tuxtxt_stop(); tuxtxt_clear_cache(); tuxtxt_cache.page = 0x100; tuxtxt_cache.vtxtpid = tpid; ret = tuxtxt_start_thread(); } else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving) { ret = tuxtxt_start_thread(); } pthread_mutex_unlock(&tuxtxt_control_lock); return ret; }
void tuxtxt_start(int tpid, int source) { if (tpid < 0) { printf("tuxtxt: invalid PID!\n"); return; } if (tuxtxt_cache.vtxtpid != tpid) { tuxtxt_stop(); tuxtxt_clear_cache(); //tuxtxt_cache.page = 0x100; tuxtxt_cache.page = 0; // avoid pre-loading 0x100 (conflicts with subtitles) tuxtxt_cache.vtxtpid = tpid; tuxtxt_start_thread(source); } else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving) { tuxtxt_start_thread(source); } }