[Toxine-cvs] CVS: toxine/src commands.c,1.83,1.84 xine_commands.c,1.55,1.56
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2004-07-23 12:51:48
|
Update of /cvsroot/toxine/toxine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1518 Modified Files: commands.c xine_commands.c Log Message: fix thread scheduling priority code compilation. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- commands.c 23 Jul 2004 12:09:47 -0000 1.83 +++ commands.c 23 Jul 2004 12:51:39 -0000 1.84 @@ -609,8 +609,6 @@ */ int toxine_video_out_init(toxine_t *tox) { int i = 0; - pthread_attr_t pth_attrs; - struct sched_param pth_params; error_code_clear(tox); @@ -671,13 +669,20 @@ tox->video.loop_thread = 0; if(tox->video.cur_plugin->video_out_event_loop) { + pthread_attr_t pth_attrs; +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + struct sched_param pth_params; +#endif + pthread_attr_init(&pth_attrs); + +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_attr_getschedparam(&pth_attrs, &pth_params); pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); pthread_attr_setschedparam(&pth_attrs, &pth_params); - - pthread_create(&tox->video.loop_thread, &pth_attrs, - tox->video.cur_plugin->video_out_event_loop, (void *)tox); +#endif + + pthread_create(&tox->video.loop_thread, &pth_attrs, tox->video.cur_plugin->video_out_event_loop, (void *)tox); } } Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- xine_commands.c 23 Jul 2004 09:25:42 -0000 1.55 +++ xine_commands.c 23 Jul 2004 12:51:39 -0000 1.56 @@ -644,17 +644,22 @@ (tox->playlist.mmk[tox->playlist.cur]->start < tox->playlist.mmk[tox->playlist.cur]->end)) { pthread_attr_t pth_attrs; - struct sched_param pth_params; +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + struct sched_param pth_params; +#endif void *v; if(tox->playlist.thread_num > 0) pthread_join(tox->playlist.end_thread, &v); - pthread_attr_init(&pth_attrs); + pthread_attr_init(&pth_attrs); + +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_attr_getschedparam(&pth_attrs, &pth_params); pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); pthread_attr_setschedparam(&pth_attrs, &pth_params); - +#endif + pthread_create(&tox->playlist.end_thread, &pth_attrs, toxine_end_thread,(void *)tox); } } |