From 6c472b5c3e4c6552cf26a759486cadabda8513c4 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 2 Sep 2001 22:26:54 +0000 Subject: last bugfixes: make xine engine handle demuxer that may fail to initialize CVS patchset: 554 CVS date: 2001/09/02 22:26:54 --- src/demuxers/demux_avi.c | 12 +++++++++--- src/xine-engine/xine.c | 25 +++++++++++++++++-------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 55c7f117d..a2e156ca4 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.32 2001/09/02 16:19:44 guenter Exp $ + * $Id: demux_avi.c,v 1.33 2001/09/02 22:26:54 guenter Exp $ * * demultiplexer for avi streams * @@ -776,7 +776,7 @@ static void *demux_avi_loop (void *this_gen) { do { - /* printf ("avi loop (status %d)\n", this->status); */ + /* printf ("avi loop (status %d)\n", this->status); */ if (!demux_avi_next(this)) this->status = DEMUX_FINISHED; @@ -797,7 +797,7 @@ static void *demux_avi_loop (void *this_gen) { } } - xprintf (VERBOSE|DEMUX, "demux_avi: demux loop finished.\n"); + printf ("demux_avi: demux loop finished.\n"); pthread_exit(NULL); @@ -903,6 +903,8 @@ static void demux_avi_start (demux_plugin_t *this_gen, this->avi->video_posf++; if (this->avi->video_posf>this->avi->video_frames) { this->status = DEMUX_FINISHED; + + printf ("demux_avi: video seek to start failed\n"); return; } } @@ -918,6 +920,8 @@ static void demux_avi_start (demux_plugin_t *this_gen, this->avi->video_posf++; if (this->avi->video_posf>this->avi->video_frames) { this->status = DEMUX_FINISHED; + + printf ("demux_avi: video seek to start failed\n"); return; } } @@ -930,6 +934,8 @@ static void demux_avi_start (demux_plugin_t *this_gen, this->avi->audio_posc++; if (this->avi->audio_posc>this->avi->audio_chunks) { this->status = DEMUX_FINISHED; + + printf ("demux_avi: audio seek to start failed\n"); return; } } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index a894aac63..5da36c630 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.55 2001/09/01 17:10:01 jkeil Exp $ + * $Id: xine.c,v 1.56 2001/09/02 22:26:54 guenter Exp $ * * top-level xine functions * @@ -266,15 +266,24 @@ void xine_play (xine_t *this, char *mrl, this->get_next_mrl_cb, this->branched_cb); - this->status = XINE_PLAY; - strncpy (this->cur_mrl, mrl, 1024); + if (this->cur_demuxer_plugin->get_status(this->cur_demuxer_plugin) != DEMUX_OK) { + printf("xine_play: demuxer failed to start\n"); + + this->cur_input_plugin->close(this->cur_input_plugin); - this->metronom->set_speed (this->metronom, SPEED_NORMAL); - this->audio_mute = 0; - this->speed = SPEED_NORMAL; + this->status = XINE_STOP; + } else { + + this->status = XINE_PLAY; + strncpy (this->cur_mrl, mrl, 1024); + + this->metronom->set_speed (this->metronom, SPEED_NORMAL); + this->audio_mute = 0; + this->speed = SPEED_NORMAL; + + printf ("xine_play: demuxer started\n"); + } - printf ("xine_play: demuxer started\n"); - pthread_mutex_unlock (&this->xine_lock); } -- cgit v1.2.3