diff options
-rw-r--r-- | src/xine-engine/xine.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 95ae918d9..75416701a 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.161 2002/09/22 14:29:40 mroi Exp $ + * $Id: xine.c,v 1.162 2002/10/03 17:46:29 jkeil Exp $ * * top-level xine functions * @@ -603,38 +603,44 @@ void xine_exit (xine_t *this) { int i; - this->status = XINE_STATUS_QUIT; + /* skip some cleanup steps, when xine_init wasn't run */ + if (this->video_driver && this->metronom) { - xine_stop(this); + /* cleanup things from xine_init... */ + this->status = XINE_STATUS_QUIT; - pthread_mutex_lock (&this->finished_lock); + xine_stop(this); - if (this->finished_thread_running) - pthread_join (this->finished_thread, NULL); + pthread_mutex_lock (&this->finished_lock); - pthread_mutex_unlock (&this->finished_lock); + if (this->finished_thread_running) + pthread_join (this->finished_thread, NULL); - printf ("xine_exit: shutdown audio\n"); + pthread_mutex_unlock (&this->finished_lock); - audio_decoder_shutdown (this); + printf ("xine_exit: shutdown audio\n"); - printf ("xine_exit: shutdown video\n"); + audio_decoder_shutdown (this); - video_decoder_shutdown (this); + printf ("xine_exit: shutdown video\n"); - this->osd_renderer->close( this->osd_renderer ); - this->video_out->exit (this->video_out); - this->video_fifo->dispose (this->video_fifo); + video_decoder_shutdown (this); - this->status = XINE_STATUS_QUIT; + this->osd_renderer->close( this->osd_renderer ); + this->video_out->exit (this->video_out); + this->video_fifo->dispose (this->video_fifo); - printf ("xine_exit: bye!\n"); + this->metronom->exit (this->metronom); + + printf ("xine_exit: bye!\n"); + } + + /* cleanup things from xine_new... */ + this->status = XINE_STATUS_QUIT; for (i = 0; i < XINE_LOG_NUM; i++) this->log_buffers[i]->dispose (this->log_buffers[i]); - this->metronom->exit (this->metronom); - dispose_plugins (this); xine_profiler_print_results (); this->config->dispose(this->config); |