diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-12-27 19:14:41 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-12-27 19:14:41 +0000 |
commit | c776d1a882ea9edc0718e4ceb9c6fd4fc4357e56 (patch) | |
tree | c101bdac26ccb3ab47178b47918ec52fc006b316 | |
parent | 5bf66c7ea3029266f2885dc6232639144c52375a (diff) | |
download | xine-lib-c776d1a882ea9edc0718e4ceb9c6fd4fc4357e56.tar.gz xine-lib-c776d1a882ea9edc0718e4ceb9c6fd4fc4357e56.tar.bz2 |
move first frame signal deeper into video out to the place where the frames are
actually displayed and on the other side timeout the wait for the signal
-> improves frame display during seeking
CVS patchset: 3698
CVS date: 2002/12/27 19:14:41
-rw-r--r-- | src/xine-engine/video_out.c | 28 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 10 |
2 files changed, 25 insertions, 13 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 71068a958..4ff1328fe 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.126 2002/12/27 03:40:07 miguelfreitas Exp $ + * $Id: video_out.c,v 1.127 2002/12/27 19:14:41 mroi Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -337,16 +337,6 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { vo_frame_driver_copy(img); /* - * Wake up xine_play if it's waiting for a frame - */ - pthread_mutex_lock (&stream->first_frame_lock); - if (stream->first_frame_flag) { - stream->first_frame_flag = 0; - pthread_cond_broadcast(&stream->first_frame_reached); - } - pthread_mutex_unlock (&stream->first_frame_lock); - - /* * put frame into FIFO-Buffer */ @@ -647,6 +637,7 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { static void overlay_and_display_frame (vos_t *this, vo_frame_t *img, int64_t vpts) { + xine_stream_t *stream; #ifdef LOG printf ("video_out: displaying image with vpts = %lld\n", @@ -677,6 +668,21 @@ static void overlay_and_display_frame (vos_t *this, this->driver->display_frame (this->driver, img); + /* + * Wake up xine_play if it's waiting for a frame + */ + pthread_mutex_lock(&this->streams_lock); + for (stream = xine_list_first_content(this->streams); stream; + stream = xine_list_next_content(this->streams)) { + pthread_mutex_lock (&stream->first_frame_lock); + if (stream->first_frame_flag) { + stream->first_frame_flag = 0; + pthread_cond_broadcast(&stream->first_frame_reached); + } + pthread_mutex_unlock (&stream->first_frame_lock); + } + pthread_mutex_unlock(&this->streams_lock); + this->redraw_needed = 0; } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 57b74387a..14ad99c45 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.205 2002/12/27 03:40:07 miguelfreitas Exp $ + * $Id: xine.c,v 1.206 2002/12/27 19:14:41 mroi Exp $ * * top-level xine functions * @@ -29,6 +29,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <sys/time.h> #include <fcntl.h> #include <string.h> #include <stdlib.h> @@ -748,7 +749,12 @@ static int xine_play_internal (xine_stream_t *stream, int start_pos, int start_t pthread_mutex_lock (&stream->first_frame_lock); /* FIXME: howto detect if video frames will be produced */ if (stream->first_frame_flag && stream->video_decoder_plugin) { - pthread_cond_wait(&stream->first_frame_reached, &stream->first_frame_lock); + struct timeval tv; + struct timespec ts; + gettimeofday(&tv, NULL); + ts.tv_sec = tv.tv_sec + 2; + ts.tv_nsec = tv.tv_usec * 1000; + pthread_cond_timedwait(&stream->first_frame_reached, &stream->first_frame_lock, &ts); } pthread_mutex_unlock (&stream->first_frame_lock); |