summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2010-07-25 16:37:27 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2010-07-25 16:37:27 +0100
commit51ee5df118326a3d2374f2432fff63dd3edceaf6 (patch)
tree6000b579c7ee6a062e3e642a48c74d68a23bf3d3 /src/xine-engine
parent9d5da6a3aae928d7fd702d03ea8212f2db48dd5b (diff)
parent070ab73cf3ac064f23895cb19b2e67717f42077d (diff)
downloadxine-lib-51ee5df118326a3d2374f2432fff63dd3edceaf6.tar.gz
xine-lib-51ee5df118326a3d2374f2432fff63dd3edceaf6.tar.bz2
Merge from 1.1; resync translation files.
--HG-- rename : po/libxine1.pot => po/libxine2.pot rename : src/libmad/xine_mad_decoder.c => src/audio_dec/xine_mad_decoder.c rename : src/libspucmml/xine_cmml_decoder.c => src/spu_dec/cmml_decoder.c
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_decoder.c4
-rw-r--r--src/xine-engine/audio_out.c2
-rw-r--r--src/xine-engine/demux.c7
-rw-r--r--src/xine-engine/video_decoder.c8
-rw-r--r--src/xine-engine/video_out.c2
5 files changed, 17 insertions, 6 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c
index 687121457..e2d0acd04 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,
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 6405f6346..5bb8242ae 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -2286,7 +2286,9 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver,
this->audio_loop_running = 1;
pthread_attr_init(&pth_attrs);
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM);
+#endif
this->audio_thread_created = 1;
if ((err = pthread_create (&this->audio_thread,
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 0321d7404..d61ca963a 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -343,13 +343,8 @@ static void *demux_loop (void *stream_gen) {
/* someone may want to interrupt us */
if (_x_action_pending(stream)) {
- struct timeval tv;
struct timespec ts;
-
- gettimeofday(&tv, NULL);
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = (tv.tv_usec + 100000) * 1000;
-
+ ts = _x_compute_interval(100);
pthread_cond_timedwait (&stream->demux_resume, &stream->demux_lock, &ts);
}
}
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index c548d12ef..29bc26d69 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.c
@@ -42,6 +42,10 @@
#define SPU_SLEEP_INTERVAL (90000/2)
+#ifndef SCHED_OTHER
+#define SCHED_OTHER 0
+#endif
+
static void update_spu_decoder (xine_stream_t *stream, int type) {
@@ -487,7 +491,9 @@ int _x_video_decoder_init (xine_stream_t *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
@@ -516,10 +522,12 @@ int _x_video_decoder_init (xine_stream_t *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
stream->video_thread_created = 1;
if ((err = pthread_create (&stream->video_thread,
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 4372226ad..ea04051e2 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -1970,7 +1970,9 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
this->grab_only = 0;
pthread_attr_init(&pth_attrs);
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM);
+#endif
if ((err = pthread_create (&this->video_thread,
&pth_attrs, video_out_loop, this)) != 0) {