From c0619b8e4099395749c048af84b6ff9337f339ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 26 Aug 2007 22:19:06 +0200 Subject: 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. --- src/video_out/video_out_xxmc.c | 19 +++++++------------ 1 file 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))) { -- cgit v1.2.3