From 047be6140aecd0f18ea0f6ad26590dccd51f0afd Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 20 Nov 2001 14:03:15 +0000 Subject: make user's stop/quit work faster CVS patchset: 1088 CVS date: 2001/11/20 14:03:15 --- src/xine-engine/xine.c | 49 ++++++++++++++--------------------------- src/xine-engine/xine_internal.h | 3 ++- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 7239063a0..cc82eb3eb 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.77 2001/11/20 12:41:58 miguelfreitas Exp $ + * $Id: xine.c,v 1.78 2001/11/20 14:03:15 miguelfreitas Exp $ * * top-level xine functions * @@ -61,7 +61,7 @@ void * xine_notify_stream_finished_thread (void * this_gen) { xine_t *this = this_gen; xine_event_t event; - xine_stop (this); + xine_stop_internal (this); event.type = XINE_EVENT_PLAYBACK_FINISHED; @@ -91,7 +91,7 @@ void xine_notify_stream_finished (xine_t *this) { } } -void xine_stop (xine_t *this) { +void xine_stop_internal (xine_t *this) { pthread_mutex_lock (&this->xine_lock); @@ -132,6 +132,18 @@ void xine_stop (xine_t *this) { pthread_mutex_unlock (&this->xine_lock); } +void xine_stop (xine_t *this) { + xine_stop_internal(this); + + /* + this will make output threads discard about everything + am i abusing of xine architeture? :) + */ + this->metronom->adjust_clock(this->metronom, + this->metronom->get_current_time(this->metronom) + 30 * 90000 ); +} + + /* * ***** * Demuxers probing stuff @@ -334,35 +346,8 @@ int xine_eject (xine_t *this) { void xine_exit (xine_t *this) { - printf ("xine_exit: try to get lock...\n"); - - pthread_mutex_lock (&this->xine_lock); - - this->metronom->set_speed (this->metronom, SPEED_NORMAL); - this->speed = SPEED_NORMAL; - this->status = XINE_STOP; - - /* - * stop decoder threads - */ - - if(this->cur_demuxer_plugin) { - printf ("xine_exit: closing demuxer\n"); - - this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); - this->cur_demuxer_plugin = NULL; - } - - if(this->cur_input_plugin) { - printf ("xine_exit: closing input plugin\n"); - - this->cur_input_plugin->stop (this->cur_input_plugin); - this->cur_input_plugin->close(this->cur_input_plugin); - this->cur_input_plugin = NULL; - } - - pthread_mutex_unlock (&this->xine_lock); - + xine_stop(this); + printf ("xine_exit: shutdown audio\n"); audio_decoder_shutdown (this); diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index ad8403b7d..118ee0950 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -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_internal.h,v 1.56 2001/11/20 12:41:58 miguelfreitas Exp $ + * $Id: xine_internal.h,v 1.57 2001/11/20 14:03:15 miguelfreitas Exp $ * */ @@ -263,6 +263,7 @@ int xine_get_av_offset (xine_t *this); /* * stop playing */ +void xine_stop_internal (xine_t *this); void xine_stop (xine_t *this); /* -- cgit v1.2.3