summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2013-08-22 16:49:00 +0200
committerTorsten Jager <t.jager@gmx.de>2013-08-22 16:49:00 +0200
commit9b35b0ffb21b25a60c95ffc71aa10082341beec3 (patch)
tree7ec445187e90b07d1ad787a505511da3e1ff9bef
parentf2d9657f5be7d58b67e7203e0e6549dcbe7e3fdb (diff)
downloadxine-lib-9b35b0ffb21b25a60c95ffc71aa10082341beec3.tar.gz
xine-lib-9b35b0ffb21b25a60c95ffc71aa10082341beec3.tar.bz2
fixed another potential xine_play () hang
xine_play() may be called from a thread that has the display device locked (eg an X window event handler). If it is waiting for a frame we better wake it up _before_ we start displaying, or the first 10 seconds of video are lost.
-rw-r--r--src/xine-engine/video_out.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 5a31e2240..7d92991a5 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -1364,21 +1364,11 @@ static void overlay_and_display_frame (vos_t *this,
pthread_mutex_unlock( &img->stream->current_extra_info_lock );
}
- if (this->overlay_source) {
- this->overlay_source->multiple_overlay_blend (this->overlay_source,
- vpts,
- this->driver, img,
- this->video_loop_running && this->overlay_enabled);
- }
-
- vo_grab_current_frame (this, img, vpts);
-
- this->driver->display_frame (this->driver, img);
-
- /*
- * Wake up xine_play if it's waiting for a frame
+ /* xine_play() may be called from a thread that has the display device locked
+ * (eg an X window event handler). If it is waiting for a frame we better wake
+ * it up _before_ we start displaying, or the first 10 seconds of video are lost.
*/
- if( this->last_frame->is_first ) {
+ if( img->is_first ) {
pthread_mutex_lock(&this->streams_lock);
for (ite = xine_list_front(this->streams); ite;
ite = xine_list_next(this->streams, ite)) {
@@ -1394,6 +1384,17 @@ static void overlay_and_display_frame (vos_t *this,
pthread_mutex_unlock(&this->streams_lock);
}
+ if (this->overlay_source) {
+ this->overlay_source->multiple_overlay_blend (this->overlay_source,
+ vpts,
+ this->driver, img,
+ this->video_loop_running && this->overlay_enabled);
+ }
+
+ vo_grab_current_frame (this, img, vpts);
+
+ this->driver->display_frame (this->driver, img);
+
this->redraw_needed = 0;
}