diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/buffer.c | 24 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 6 |
2 files changed, 25 insertions, 5 deletions
diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index a05660fb2..fff308399 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.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: buffer.c,v 1.5 2001/07/03 21:25:04 guenter Exp $ + * $Id: buffer.c,v 1.6 2001/08/12 15:12:54 guenter Exp $ * * * contents: @@ -59,13 +59,31 @@ static void buffer_pool_free (buf_element_t *element) { pthread_mutex_unlock (&this->buffer_pool_mutex); } +/* + * helper function to release buffer pool lock + * in case demux thread is cancelled + */ + +void pool_release_lock (void *arg) { + + pthread_mutex_t *mutex = (pthread_mutex_t *) arg; + + /* printf ("pool release lock\n"); */ + + pthread_mutex_unlock (mutex); + +} + /* - * check if there are no more free elements + * allocate a buffer from buffer pool */ + static buf_element_t *buffer_pool_alloc (fifo_buffer_t *this) { buf_element_t *buf; + pthread_cleanup_push( pool_release_lock, &this->buffer_pool_mutex); + pthread_mutex_lock (&this->buffer_pool_mutex); while (!this->buffer_pool_top) { @@ -76,6 +94,8 @@ static buf_element_t *buffer_pool_alloc (fifo_buffer_t *this) { this->buffer_pool_top = this->buffer_pool_top->next; this->buffer_pool_num_free--; + pthread_cleanup_pop (0); + pthread_mutex_unlock (&this->buffer_pool_mutex); return buf; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 4659fb993..864641e6d 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.38 2001/07/27 21:46:59 f1rmb Exp $ + * $Id: xine.c,v 1.39 2001/08/12 15:12:54 guenter Exp $ * * top-level xine functions * @@ -205,7 +205,6 @@ static void xine_play_internal (xine_t *this, char *mrl, if (!this->cur_input_plugin) { perror ("open input source"); this->cur_demuxer_plugin = NULL; - this->status = XINE_STOP; return; } @@ -224,7 +223,6 @@ static void xine_play_internal (xine_t *this, char *mrl, if(!find_demuxer(this, mrl)) { printf ("xine: couldn't find demuxer for >%s<\n", mrl); - this->status = XINE_STOP; return; } @@ -251,6 +249,8 @@ static void xine_play_internal (xine_t *this, char *mrl, this->status = XINE_PLAY; strncpy (this->cur_mrl, mrl, 1024); + printf ("xine: demuxer started\n"); + } void xine_play (xine_t *this, char *MRL, int spos) { |