summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2007-03-08 13:33:18 +0000
committerphintuka <phintuka>2007-03-08 13:33:18 +0000
commit03207929b80b133a714a9efa90c800106378b265 (patch)
tree005e5e93afe93541d44ef2804f9f2d86ba2de004
parentd38d94d2b68a69deb5e7d9c5afdb70b15fc345fc (diff)
downloadxineliboutput-03207929b80b133a714a9efa90c800106378b265.tar.gz
xineliboutput-03207929b80b133a714a9efa90c800106378b265.tar.bz2
Set cursor and blanking off only when running on terminal (keyboard input)
Added short delay after keyboard thread creation Mac OS X compability fix (patch by Tero Siironen)
-rw-r--r--xine_frontend_main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 942aabb7..775e0c3e 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.26 2007-01-27 17:48:41 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.27 2007-03-08 13:33:18 phintuka Exp $
*
*/
@@ -133,6 +133,9 @@ static void *kbd_receiver_thread(void *fe)
terminate_key_pressed = 0;
+ system("setterm -cursor off");
+ system("setterm -blank off");
+
/* Set stdin to deliver keypresses without buffering whole lines */
tcgetattr(STDIN_FILENO, &saved_tm);
if (tcgetattr(STDIN_FILENO, &tm) == 0) {
@@ -143,9 +146,6 @@ static void *kbd_receiver_thread(void *fe)
tcsetattr(STDIN_FILENO, TCSANOW, &tm);
}
- system("setterm -cursor off");
- system("setterm -blank off");
-
do {
errno = 0;
code = read_key_seq();
@@ -521,6 +521,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Can't create new thread for keyboard (%s)\n",
strerror(err));
}
+ sleep(1);
}
do {
@@ -567,7 +568,11 @@ int main(int argc, char *argv[])
fflush(stderr);
while(fe->fe_run(fe) && !fe->xine_is_finished(fe,0) && !terminate_key_pressed)
+#ifdef __APPLE__
+ sched_yield();
+#else
pthread_yield();
+#endif
fe->xine_close(fe);
firsttry = 0;