diff options
Diffstat (limited to 'src/xine-engine/video_out.c')
-rw-r--r-- | src/xine-engine/video_out.c | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 19d635d76..2a3ee1980 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.225 2006/03/25 01:26:34 dsalt Exp $ + * $Id: video_out.c,v 1.228 2007/04/01 01:03:06 dgp85 Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -93,11 +93,20 @@ typedef struct { vo_frame_t *last_frame; vo_frame_t *img_backup; - int redraw_needed; + + uint32_t video_loop_running:1; + uint32_t video_opened:1; + + uint32_t overlay_enabled:1; + + uint32_t warn_threshold_event_sent:1; + + /* do we true real-time output or is this a grab only instance ? */ + uint32_t grab_only:1; + + uint32_t redraw_needed:3; int discard_frames; - int video_loop_running; - int video_opened; pthread_t video_thread; int num_frames_delivered; @@ -108,17 +117,12 @@ typedef struct { int warn_skipped_threshold; int warn_discarded_threshold; int warn_threshold_exceeded; - int warn_threshold_event_sent; /* pts value when decoder delivered last video frame */ int64_t last_delivery_pts; video_overlay_manager_t *overlay_source; - int overlay_enabled; - - /* do we true real-time output or is this a grab only instance ? */ - int grab_only; extra_info_t *extra_info_base; /* used to free mem chunk */ @@ -600,7 +604,7 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { */ send_event = (this->warn_threshold_exceeded == 5 && !this->warn_threshold_event_sent); - this->warn_threshold_event_sent += send_event; + this->warn_threshold_event_sent = send_event; pthread_mutex_lock(&this->streams_lock); for (ite = xine_list_front(this->streams); ite; @@ -1195,7 +1199,7 @@ static void *video_out_loop (void *this_gen) { if (this->clock->speed == XINE_SPEED_PAUSE) paused_loop (this, vpts); - if (next_frame_vpts) { + if (next_frame_vpts && this->clock->speed > 0) { usec_to_sleep = (next_frame_vpts - vpts) * 100 * XINE_FINE_SPEED_NORMAL / (9 * this->clock->speed); } else { /* we don't know when the next frame is due, only wait a little */ @@ -1783,11 +1787,23 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon this->frame_drop_limit = 3; this->frame_drop_cpt = 0; - num_frame_buffers = driver->get_property (driver, VO_PROP_MAX_NUM_FRAMES); - - if (!num_frame_buffers) - num_frame_buffers = NUM_FRAME_BUFFERS; /* default */ - else if (num_frame_buffers<5) + /* default number of video frames from config */ + num_frame_buffers = xine->config->register_num (xine->config, + "engine.buffers.video_num_frames", + NUM_FRAME_BUFFERS, /* default */ + _("default number of video frames"), + _("The default number of video frames to request " + "from xine video out driver. Some drivers will " + "override this setting with their own values."), + 20, NULL, NULL); + + /* check driver's limit and use the smaller value */ + i = driver->get_property (driver, VO_PROP_MAX_NUM_FRAMES); + if (i && i < num_frame_buffers) + num_frame_buffers = i; + + /* we need at least 5 frames */ + if (num_frame_buffers<5) num_frame_buffers = 5; this->extra_info_base = calloc (num_frame_buffers, |