summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2007-04-15 22:21:51 +0200
committerReinhard Nißl <rnissl@gmx.de>2007-04-15 22:21:51 +0200
commitb18b4faf8fa913ccaeec3003d6bcfa273267db30 (patch)
treec8ea70a5c9d4d4fcfc530c6c1827833c8582857d /src/xine-engine
parent1d5c7d9f5766b92de1e0c43b38af3086b3560cef (diff)
downloadxine-lib-b18b4faf8fa913ccaeec3003d6bcfa273267db30.tar.gz
xine-lib-b18b4faf8fa913ccaeec3003d6bcfa273267db30.tar.bz2
Avoid immediate frame drops by giving decoder a further chance to
supply decoded frames. There can still be scheduling delays which may let the number of frames ready for displaying to drop below frame drop limit just for a short period of time. Therefore the changes remember that the decoder should have been asked to drop some frames but do not actually have the decoder to drop some frames. When the situation has improved at the next time when the check is performed, the remembered frame drop is canceled or otherwise (when the number of frames is still below frame drop limit) executed.
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/video_out.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index c75b7058a..6177cbef8 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -132,6 +132,7 @@ typedef struct {
int frame_drop_limit_max;
int frame_drop_limit;
int frame_drop_cpt;
+ int frame_drop_suggested;
int crop_left, crop_right, crop_top, crop_bottom;
} vos_t;
@@ -499,6 +500,21 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) {
frames_to_skip < 0)
frames_to_skip = 0;
+ /* Do not drop frames immediately, but remember this as suggestion and give
+ * decoder a further chance to supply frames.
+ * This avoids unnecessary frame drops in situations where there is only
+ * a very little number of image buffers, e. g. when using xxmc.
+ */
+ if (this->frame_drop_suggested && frames_to_skip == 0)
+ this->frame_drop_suggested = 0;
+
+ if (frames_to_skip > 0) {
+ if (!this->frame_drop_suggested) {
+ this->frame_drop_suggested = 1;
+ frames_to_skip = 0;
+ }
+ }
+
lprintf ("delivery diff : %" PRId64 ", current vpts is %" PRId64 ", %d frames to skip\n",
diff, cur_vpts, frames_to_skip);
@@ -1872,6 +1888,7 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
this->frame_drop_limit = this->frame_drop_limit_max;
this->frame_drop_cpt = 0;
+ this->frame_drop_suggested = 0;
this->extra_info_base = calloc (num_frame_buffers,
sizeof(extra_info_t));