From 9f4b00dc969a215674d0c943f3fac578de4b1f75 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Mon, 10 Jun 2002 00:26:10 +0000 Subject: revert previous commit CVS patchset: 2052 CVS date: 2002/06/10 00:26:10 --- src/xine-engine/xine.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 39524cd6e..804c24593 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.137 2002/06/08 20:14:08 miguelfreitas Exp $ + * $Id: xine.c,v 1.138 2002/06/10 00:26:10 miguelfreitas Exp $ * * top-level xine functions * @@ -68,15 +68,16 @@ static void _logo_change_cb(void *data, cfg_entry_t *cfg) { /* * Start playback of new mrl only if - * current status is XINE_STOP + * current status is XINE_STOP or XINE_LOGO */ pthread_mutex_lock (&this->xine_lock); - if( this->status == XINE_STOP ) { + if((this->status == XINE_LOGO) || (this->status == XINE_STOP)) { xine_stop_internal(this); this->metronom->adjust_clock(this->metronom, this->metronom->get_current_time(this->metronom) + 30 * 90000 ); pthread_mutex_lock (&this->logo_lock); xine_play_internal(this, this->logo_mrl, 0, 0); + this->status = XINE_LOGO; pthread_mutex_unlock (&this->logo_lock); } pthread_mutex_unlock (&this->xine_lock); @@ -101,6 +102,7 @@ void * xine_notify_stream_finished_thread (void * this_gen) { pthread_mutex_lock (&this->xine_lock); if (this->status == XINE_STOP) { xine_play_internal(this, this->logo_mrl, 0, 0); + this->status = XINE_LOGO; } pthread_mutex_unlock (&this->xine_lock); } @@ -257,7 +259,6 @@ void xine_stop_internal (xine_t *this) { } void xine_stop (xine_t *this) { - pthread_mutex_lock (&this->xine_lock); xine_stop_internal(this); @@ -270,15 +271,11 @@ void xine_stop (xine_t *this) { if(this->status == XINE_STOP) { pthread_mutex_lock (&this->logo_lock); - xine_play_internal(this, this->logo_mrl, 0, 0); + xine_play_internal(this, this->logo_mrl,0,0); + this->status = XINE_LOGO; pthread_mutex_unlock (&this->logo_lock); } pthread_mutex_unlock (&this->xine_lock); - - /* wait while logo is playing. - * avoid races if xine_play() is called after xine_stop() */ - while( this->status == XINE_PLAY ) - xine_usec_sleep(10000); } @@ -369,7 +366,7 @@ int xine_play_internal (xine_t *this, char *mrl, * stop engine only for different mrl */ - if ((this->status == XINE_PLAY && strcmp (mrl, this->cur_mrl)) ) { + if ((this->status == XINE_PLAY && strcmp (mrl, this->cur_mrl)) || (this->status == XINE_LOGO)) { if(this->cur_demuxer_plugin) { this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); @@ -485,7 +482,7 @@ int xine_play_internal (xine_t *this, char *mrl, int xine_play (xine_t *this, char *mrl, int start_pos, int start_time) { - int ret; +int ret; pthread_mutex_lock (&this->xine_lock); ret = xine_play_internal (this, mrl, start_pos, start_time); @@ -504,8 +501,8 @@ int xine_eject (xine_t *this) { pthread_mutex_lock (&this->xine_lock); status = 0; - if ( this->status == XINE_STOP - && this->last_input_plugin && this->last_input_plugin->eject_media) { + if (((this->status == XINE_STOP) || (this->status == XINE_LOGO)) + && this->last_input_plugin && this->last_input_plugin->eject_media) { status = this->last_input_plugin->eject_media (this->last_input_plugin); } @@ -700,9 +697,8 @@ xine_t *xine_init (vo_driver_t *vo, pthread_mutex_lock (&this->logo_lock); xine_play(this, this->logo_mrl,0,0); + this->status = XINE_LOGO; pthread_mutex_unlock (&this->logo_lock); - while( this->status == XINE_PLAY ) - xine_usec_sleep(10000); return this; } -- cgit v1.2.3