1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
$NetBSD: patch-aa,v 1.2 2004/03/11 17:26:02 jmmv Exp $
--- src/xine-engine/video_decoder.c.orig 2003-12-08 11:36:27.000000000 +0100
+++ src/xine-engine/video_decoder.c
@@ -41,6 +41,10 @@
#include "xineutils.h"
#include <sched.h>
+#ifndef SCHED_OTHER
+#define SCHED_OTHER 0
+#endif
+
static void update_spu_decoder (xine_stream_t *stream, int type) {
int streamtype = (type>>16) & 0xFF;
@@ -390,7 +394,9 @@ void _x_video_decoder_init (xine_stream_
} else {
pthread_attr_t pth_attrs;
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
struct sched_param pth_params;
+#endif
int err, num_buffers;
/* The fifo size is based on dvd playback where buffers are filled
* with 2k of data. With 500 buffers and a typical video data rate
@@ -411,10 +417,12 @@ void _x_video_decoder_init (xine_stream_
stream->spu_track_map_entries = 0;
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
if ((err = pthread_create (&stream->video_thread,
&pth_attrs, video_decoder_loop, stream)) != 0) {
|