From 2241baa294539a33d8bc6137e633bb4c93c22b4e Mon Sep 17 00:00:00 2001 From: Ian Rae Date: Mon, 14 Sep 2009 10:01:43 -0700 Subject: Protected access to stream->demux_action_pending The deadlock was caused by the unprotected use of stream->demux_action_pending internal variable from play_internal() and from within the demuxer loop. Direct access to demux_action_pending is replaced with _x_action_raise() and _x_action_lower(), which use a mutex for thread safety. --- include/xine/xine_internal.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/xine') diff --git a/include/xine/xine_internal.h b/include/xine/xine_internal.h index b12d20880..ac8e6cabf 100644 --- a/include/xine/xine_internal.h +++ b/include/xine/xine_internal.h @@ -334,6 +334,7 @@ struct xine_stream_s { /* demux thread stuff */ pthread_t demux_thread; pthread_mutex_t demux_lock; + pthread_mutex_t demux_action_lock; pthread_cond_t demux_resume; pthread_mutex_t demux_mutex; /* used in _x_demux_... functions to synchronize order of pairwise A/V buffer operations */ @@ -421,6 +422,9 @@ off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_ int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED; +void _x_action_raise (xine_stream_t *stream) XINE_PROTECTED; +void _x_action_lower (xine_stream_t *stream) XINE_PROTECTED; + void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size, int64_t pts, uint32_t type, uint32_t decoder_flags, int input_normpos, int input_time, int total_time, -- cgit v1.2.3