[vlc-devel] Re: FW: Patch to video_output.c stops 'late picture skipped' looping

Sigmund Augdal sigmunau at stud.ntnu.no
Mon Sep 15 08:43:31 CEST 2003


Hi there. I have integrated your solution along with some other fixes to
this part of the code, and it seems to be working very vell. I used
VOUT_DISPLAY_DELAY and not DEFAULT_PTS_DELAY, since VOUT_DISPLAY_DELAY is
defined to be the largest allowable time used on rendering ( while
DEFAULT_PTS_DELAY is something completly different ).

Thanks a lot for your contribution.

Sigmund Augdal

On Fri, Sep 12, 2003 at 11:13:17AM +1000, Simon Gittins wrote:
> Hi
> 
> I've been having issues where vlc would often stop displaying video and
> continually write "late picture skipped" messages when changing consoles
> (ie between X and text consoles).  I narrowed the problem down to
> RunThread in video_output.c, where the local variable render_time can
> spike if there is a large delay (like receiving a SIGSTOP, or in my
> case, switch terminals).  If render_time ever becomes very large (eg 0.5
> seconds), the check for late pictures will be triggered, and will
> continue to be triggered for all incoming pictures, as the loop will
> always 'coninue;' before being able to reset the render_time to
> something sane.
> 
> The proposed solution is to avoid letting time spikes into the
> render_time 'sliding mean' calculation by checking that the time is not
> above DEFAULT_PTS_DELAY.
> 
> Another solution would be to reset render_time to a reasonable value
> (eg, 0) upon entering the 'late picture skipped' conditional, but I
> imagine that this change could cause more problems than it fixes.
> 
> Probably the best (in terms of reliably filtering out render_time
> spikes) would be to replace the 'sliding mean' with a median (5 entries
> would be sufficient), but this would obviously result in a larger and
> uglier patch.
> 
> I've attached a (very small) patch with the first proposed solution
> diffed to 0.6.2.  I can rediff it to CVS if necessary.
> 
> Please CC me any replies as I am not subscribed to the list.
> 
> Thanks
> Simon Gittins
> 
> --- video_output.c.orig	2003-09-12 11:08:06.000000000 +1000
> +++ video_output.c	2003-09-12 09:32:05.000000000 +1000
> @@ -892,9 +892,18 @@
>           */
>          if( display_date != 0 && p_directbuffer != NULL )
>          {
> -            /* Store render time using a sliding mean */
> -            p_vout->render_time += mdate() - current_date;
> -            p_vout->render_time >>= 1;
> +            /*
> +             * If render_time becomes morbidly high, we will enter a 
> +             * 'late picture skipped' mode, as render_time will never
> be
> +             * updated again.  So prevent spikes from affecting
> render_time
> +             */
> +            mtime_t t = mdate() - current_date;
> +            if( t < DEFAULT_PTS_DELAY )
> +            {
> +                /* Store render time using a sliding mean */
> +                p_vout->render_time += t;
> +                p_vout->render_time >>= 1;
> +            }
>          }
>  
>          /* Give back change lock */
> 
> -- 
> This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
> To unsubscribe, please read http://developers.videolan.org/lists.html
> If you are in trouble, please contact <postmaster at videolan.org>
> 

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list