diff options
author | Reinhard Nißl <rnissl@gmx.de> | 2007-08-26 22:19:06 +0200 |
---|---|---|
committer | Reinhard Nißl <rnissl@gmx.de> | 2007-08-26 22:19:06 +0200 |
commit | c0619b8e4099395749c048af84b6ff9337f339ec (patch) | |
tree | 320d8704ac68307af1e1ed42ff918601e0fc07db | |
parent | 62d7654ffd81daef9d1f38d43d30b1e97675e614 (diff) | |
download | xine-lib-c0619b8e4099395749c048af84b6ff9337f339ec.tar.gz xine-lib-c0619b8e4099395749c048af84b6ff9337f339ec.tar.bz2 |
Protect previously shown frame from immediate reuse by decoder.
It happend that the previously shown frame was still on screen
while the decoder reused it already and the result was a mixed
picture on screen.
Protection is easy: just keep a reference to previously shown
frame and it cannot be reused by the decoder until a frame
duration has passed which should be sufficient to see the
current frame on screen.
Such referencing has already been implemented although it was
not used for deinterlacing. Therefore it had been disabled to
get an additional frame for decoding in coping with dropped
frames.
The change reenables referencing the previously shown frame.
-rw-r--r-- | src/video_out/video_out_xxmc.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 2cde18dac..0ba004127 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -1643,21 +1643,16 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) xvmc_context_reader_lock( &this->xvmc_lock ); - xxmc_add_recent_frame (this, frame); /* deinterlacing */ - /* * the current implementation doesn't need recent frames for deinterlacing, - * but as most of the time we only have a little number of frames available - * per device, we only hold references to the most recent frame by filling - * the whole buffer with the same frame + * but we need to hold references on the frame we are about to show and to + * the previous frame which is currently shown on screen. Otherwise, the + * frame on screen will be immediately reused for decoding which will then + * most often result in mixed images on screen, especially when decoding + * is faster than sending the image to the monitor, and/or when exchanging + * the overlay image is synced to retrace. */ - { - int i; - for (i = 1; i < VO_NUM_RECENT_FRAMES; i++) { - frame->vo_frame.lock(&frame->vo_frame); - xxmc_add_recent_frame (this, frame); /* deinterlacing */ - } - } + xxmc_add_recent_frame (this, frame); /* deinterlacing */ if ((frame->format == XINE_IMGFMT_XXMC) && (!xxmc->decoded || !xxmc_xvmc_surface_valid(this, frame->xvmc_surf))) { |