summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/audio_decoder.c10
-rw-r--r--src/xine-engine/demux.c8
-rw-r--r--src/xine-engine/video_decoder.c14
3 files changed, 25 insertions, 7 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c
index 9d9bddf26..188a69466 100644
--- a/src/xine-engine/audio_decoder.c
+++ b/src/xine-engine/audio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_decoder.c,v 1.103 2003/03/07 12:51:48 guenter Exp $
+ * $Id: audio_decoder.c,v 1.104 2003/03/07 15:29:30 miguelfreitas Exp $
*
*
* functions that implement audio decoding
@@ -116,7 +116,13 @@ void *audio_decoder_loop (void *stream_gen) {
pthread_cond_broadcast (&stream->counter_changed);
while (stream->finished_count_video < stream->finished_count_audio) {
- pthread_cond_wait (&stream->counter_changed, &stream->counter_lock);
+ struct timeval tv;
+ struct timespec ts;
+ gettimeofday(&tv, NULL);
+ ts.tv_sec = tv.tv_sec + 1;
+ ts.tv_nsec = tv.tv_usec * 1000;
+ /* use timedwait to workaround buggy pthread broadcast implementations */
+ pthread_cond_timedwait (&stream->counter_changed, &stream->counter_lock, &ts);
}
pthread_mutex_unlock (&stream->counter_lock);
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index e2f7c671c..1edfac777 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -125,10 +125,16 @@ void xine_demux_control_headers_done (xine_stream_t *stream) {
while ((stream->header_count_audio<header_count_audio) ||
(stream->header_count_video<header_count_video)) {
+ struct timeval tv;
+ struct timespec ts;
#ifdef LOG
printf ("xine: waiting for headers.\n");
#endif
- pthread_cond_wait (&stream->counter_changed, &stream->counter_lock);
+ gettimeofday(&tv, NULL);
+ ts.tv_sec = tv.tv_sec + 1;
+ ts.tv_nsec = tv.tv_usec * 1000;
+ /* use timedwait to workaround buggy pthread broadcast implementations */
+ pthread_cond_timedwait (&stream->counter_changed, &stream->counter_lock, &ts);
}
#ifdef LOG
printf ("xine: headers processed.\n");
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 46b349018..511e9e819 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_decoder.c,v 1.130 2003/03/06 23:30:36 hadess Exp $
+ * $Id: video_decoder.c,v 1.131 2003/03/07 15:29:32 miguelfreitas Exp $
*
*/
@@ -148,9 +148,15 @@ void *video_decoder_loop (void *stream_gen) {
if (stream->audio_fifo) {
- while (stream->finished_count_video > stream->finished_count_audio) {
- pthread_cond_wait (&stream->counter_changed, &stream->counter_lock);
- }
+ while (stream->finished_count_video > stream->finished_count_audio) {
+ struct timeval tv;
+ struct timespec ts;
+ gettimeofday(&tv, NULL);
+ ts.tv_sec = tv.tv_sec + 1;
+ ts.tv_nsec = tv.tv_usec * 1000;
+ /* use timedwait to workaround buggy pthread broadcast implementations */
+ pthread_cond_timedwait (&stream->counter_changed, &stream->counter_lock, &ts);
+ }
}
pthread_mutex_unlock (&stream->counter_lock);