/* Thread priorities */
#ifdef __APPLE__
-# define VLC_THREAD_PRIORITY_LOW (-47)
-# define VLC_THREAD_PRIORITY_INPUT 37
-# define VLC_THREAD_PRIORITY_AUDIO 37
-# define VLC_THREAD_PRIORITY_VIDEO (-47)
-# define VLC_THREAD_PRIORITY_OUTPUT 37
-# define VLC_THREAD_PRIORITY_HIGHEST 37
+# define VLC_THREAD_PRIORITY_LOW 0
+# define VLC_THREAD_PRIORITY_INPUT 22
+# define VLC_THREAD_PRIORITY_AUDIO 22
+# define VLC_THREAD_PRIORITY_VIDEO 0
+# define VLC_THREAD_PRIORITY_OUTPUT 22
+# define VLC_THREAD_PRIORITY_HIGHEST 22
#elif defined(SYS_BEOS)
# define VLC_THREAD_PRIORITY_LOW 5
if( config_GetInt( p_this, "rt-priority" ) > 0 )
#endif
{
+ struct sched_param p = { .sched_priority = i_priority, };
+ int policy;
+
/* Hack to avoid error msg */
if( config_GetType( p_this, "rt-offset" ) )
- i_priority += config_GetInt( p_this, "rt-offset" );
- if( i_priority <= 0 )
- pthread_attr_setschedpolicy (&attr, SCHED_OTHER);
+ p.sched_priority += config_GetInt( p_this, "rt-offset" );
+ if( p.sched_priority <= 0 )
+ p.sched_priority += sched_get_priority_max (policy = SCHED_OTHER);
else
- {
- struct sched_param param = { .sched_priority = i_priority, };
+ p.sched_priority += sched_get_priority_min (policy = SCHED_RR);
- param.sched_priority += sched_get_priority_min (SCHED_RR);
- pthread_attr_setschedpolicy (&attr, SCHED_RR);
- pthread_attr_setschedparam (&attr, ¶m);
- }
+ pthread_attr_setschedpolicy (&attr, policy);
+ pthread_attr_setschedparam (&attr, &p);
}
i_ret = pthread_create( &p_priv->thread_id, &attr, thread_entry, boot );