Merge branch 'review-1' of git://github.com/rayl/mlt
[melted] / src / miracle / miracle.c
index 913f785..24aac66 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * miracle.c -- A DV over IEEE 1394 TCP Server
+ * miracle.c -- MLT Video TCP Server
  *
  * Copyright (C) 2002-2003 Ushodaya Enterprises Limited
  * Authors:
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <time.h>
+#include <sched.h>
 
 #include <framework/mlt.h>
 
@@ -66,6 +67,14 @@ int main( int argc, char **argv )
        int index = 0;
        int background = 1;
        struct timespec tm = { 5, 0 };
+       struct sched_param scp;
+
+       // Use realtime scheduling if possible
+       memset( &scp, '\0', sizeof( scp ) );
+       scp.sched_priority = sched_get_priority_max( SCHED_FIFO ) - 1;
+#ifndef __DARWIN__
+       sched_setscheduler( 0, SCHED_FIFO, &scp );
+#endif
 
        mlt_factory_init( NULL );