diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/video_out/video_out_xv.c | 6 | ||||
-rw-r--r-- | src/xine-engine/audio_decoder.c | 11 | ||||
-rw-r--r-- | src/xine-engine/metronom.c | 5 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 15 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 27 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 37 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 6 |
7 files changed, 72 insertions, 35 deletions
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 044d4f26d..ab7cce4ab 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.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: video_out_xv.c,v 1.30 2001/06/02 14:41:18 f1rmb Exp $ + * $Id: video_out_xv.c,v 1.31 2001/06/03 18:08:56 guenter Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -142,7 +142,7 @@ static void xv_frame_field (vo_frame_t *vo_img, int which_field) { static void xv_frame_dispose (vo_frame_t *vo_img) { - xv_frame_t *frame = (xv_frame_t *) vo_img ; + /* xv_frame_t *frame = (xv_frame_t *) vo_img ;*/ /* FIXME: implement */ @@ -792,7 +792,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { xv_check_capability (this, VO_CAP_COLORKEY, VO_PROP_COLORKEY, attr[k], adaptor_info[i].base_id, "XV_COLORKEY"); - printf("XV_COLORKEY "); + printf("video_out_xv: colorkey is %08x ", this->props[VO_PROP_COLORKEY].value); } } } diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 3131a4e37..3aceebeec 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.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: audio_decoder.c,v 1.11 2001/05/30 02:09:24 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.12 2001/06/03 18:08:56 guenter Exp $ * * * functions that implement audio decoding @@ -183,6 +183,15 @@ void audio_decoder_init (xine_t *this) { pthread_create (&this->audio_thread, NULL, audio_decoder_loop, this) ; } +void audio_decoder_stop (xine_t *this) { + this->audio_fifo->clear(this->audio_fifo); + + if (this->cur_audio_decoder_plugin) { + this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin); + this->cur_audio_decoder_plugin = NULL; + } +} + void audio_decoder_shutdown (xine_t *this) { buf_element_t *buf; diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 24adfba3f..c1f54405a 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.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: metronom.c,v 1.6 2001/05/27 23:48:12 guenter Exp $ + * $Id: metronom.c,v 1.7 2001/06/03 18:08:56 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -68,6 +68,9 @@ static void metronom_reset (metronom_t *this) { this->stopped = 1; + this->last_pts = 0; + this->start_pts = 0; + pthread_mutex_unlock (&this->lock); } diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index fd7dc9220..bacf7a15e 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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: video_decoder.c,v 1.15 2001/05/30 02:09:24 f1rmb Exp $ + * $Id: video_decoder.c,v 1.16 2001/06/03 18:08:56 guenter Exp $ * */ @@ -121,8 +121,15 @@ void video_decoder_init (xine_t *this) { this->video_fifo = fifo_buffer_new (1500, 4096); pthread_create (&this->video_thread, NULL, video_decoder_loop, this) ; +} + +void video_decoder_stop (xine_t *this) { + this->video_fifo->clear(this->video_fifo); - printf ("video_decoder_init: video thread created\n"); + if (this->cur_video_decoder_plugin) { + this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin); + this->cur_video_decoder_plugin = NULL; + } } void video_decoder_shutdown (xine_t *this) { @@ -137,4 +144,8 @@ void video_decoder_shutdown (xine_t *this) { this->video_fifo->put (this->video_fifo, buf); pthread_join (this->video_thread, &p); + + + this->video_out->exit (this->video_out); } + diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 70a37813a..e6c4204da 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.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: video_out.c,v 1.11 2001/05/28 01:28:11 f1rmb Exp $ + * $Id: video_out.c,v 1.12 2001/06/03 18:08:56 guenter Exp $ * */ @@ -239,6 +239,26 @@ static void *video_out_loop (void *this_gen) { xprintf (VERBOSE|VIDEO, "video_out : passing to video driver, image with pts = %d\n", pts); this->driver->display_frame (this->driver, img); } + + /* + * throw away undisplayed frames + */ + + img = this->display_img_buf_queue->first; + while (img) { + + img = vo_remove_from_img_buf_queue (this->display_img_buf_queue); + pthread_mutex_lock (&img->mutex); + + if (!img->bDecoderLock) + vo_append_to_img_buf_queue (this->free_img_buf_queue, img); + + img->bDisplayLock = 0; + pthread_mutex_unlock (&img->mutex); + + img = this->display_img_buf_queue->first; + } + pthread_exit(NULL); } @@ -260,8 +280,6 @@ static vo_frame_t *vo_get_frame (vo_instance_t *this, vo_frame_t *img; - /* printf ("video_out: vo_get_frame\n"); */ - if (this->pts_per_frame != duration) { this->pts_per_frame = duration; this->pts_per_half_frame = duration / 2; @@ -281,8 +299,6 @@ static vo_frame_t *vo_get_frame (vo_instance_t *this, pthread_mutex_unlock (&img->mutex); - /* printf ("video_out: vo_get_frame done\n"); */ - return img; } @@ -358,7 +374,6 @@ static int vo_frame_draw (vo_frame_t *img) { xprintf (VERBOSE|VIDEO,"video_out: got image. vpts for picture is %d\n", pic_vpts); - cur_vpts = this->metronom->get_current_time(this->metronom); diff = pic_vpts - cur_vpts; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 2012be021..69ee62a2c 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.20 2001/05/28 21:47:43 f1rmb Exp $ + * $Id: xine.c,v 1.21 2001/06/03 18:08:56 guenter Exp $ * * top-level xine functions * @@ -89,15 +89,13 @@ void xine_stop (xine_t *this) { this->cur_input_plugin = NULL; } - this->video_fifo->clear(this->video_fifo); - this->audio_fifo->clear(this->audio_fifo); - this->spu_fifo->clear(this->spu_fifo); + video_decoder_stop (this); + audio_decoder_stop (this); - if (this->audio_out) - this->audio_out->close (this->audio_out); + this->spu_fifo->clear(this->spu_fifo); - this->metronom->reset(this->metronom); this->metronom->stop_clock (this->metronom); + this->metronom->reset(this->metronom); pthread_mutex_unlock (&this->xine_lock); } @@ -316,28 +314,25 @@ int xine_eject (xine_t *this) { void xine_exit (xine_t *this) { /* - void *p; - buf_element_t *buf; - */ - /* * stop decoder threads */ - printf ("xine.c : xine_exit FIXME - not implemented\n"); - - /* - if (this->cur_input_plugin) - this->cur_input_plugin->demux_stop (); + if(this->cur_demuxer_plugin) { + this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); + this->cur_demuxer_plugin = NULL; + } - this->fifo_funcs->fifo_buffer_clear(this->spu_fifo); + if(this->cur_input_plugin) { + this->cur_input_plugin->close(this->cur_input_plugin); + this->cur_input_plugin = NULL; + } - audio_decoder_shutdown (); - video_decoder_shutdown (); + audio_decoder_shutdown (this); + video_decoder_shutdown (this); this->status = XINE_QUIT; - config_file_save (); - */ + this->config->save (this->config); } /* diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index e38cfc70b..a832fb0e1 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.19 2001/05/24 21:41:28 guenter Exp $ + * $Id: xine_internal.h,v 1.20 2001/06/03 18:08:56 guenter Exp $ * */ @@ -289,6 +289,8 @@ void xine_notify_stream_finished (xine_t *this); void video_decoder_init (xine_t *this); +void video_decoder_stop (xine_t *this); + /* * quit video thread */ @@ -302,6 +304,8 @@ void video_decoder_shutdown (xine_t *this); void audio_decoder_init (xine_t *this); +void audio_decoder_stop (xine_t *this); + /* * quit audio thread */ |