From e9c4a618fbc47dae2cdd82d4d09ade8ec020bfe1 Mon Sep 17 00:00:00 2001 From: Matthias Drochner Date: Wed, 21 Jul 2010 15:27:33 +0000 Subject: Add _POSIX_THREAD_PRIORITY_SCHEDULING #ifdefs This is optional, and some systems don't support it. POSIX defines the _POSIX_THREAD_PRIORITY_SCHEDULING to tell that support is present. --- src/xine-engine/audio_decoder.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/xine-engine/audio_decoder.c') diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index dd15bf696..3d5ef7e6f 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -463,7 +463,9 @@ static void *audio_decoder_loop (void *stream_gen) { int _x_audio_decoder_init (xine_stream_t *stream) { pthread_attr_t pth_attrs; +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING struct sched_param pth_params; +#endif int err; if (stream->audio_out == NULL) { @@ -501,10 +503,12 @@ int _x_audio_decoder_init (xine_stream_t *stream) { */ 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_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); +#endif stream->audio_thread_created = 1; if ((err = pthread_create (&stream->audio_thread, -- cgit v1.2.3