[MPlayer-dev-eng] [PATCH] bugfix - Possible Endless loop when using sstep on AVIs

Ivo ivop at euronet.nl
Thu Sep 6 18:22:40 CEST 2007


On Thursday 06 September 2007 17:00, Kai Londenberg wrote:
> --- mplayer.c   (revision 24350)
> +++ mplayer.c   (working copy)
> @@ -2234,9 +2234,15 @@
>  static int seek(MPContext *mpctx, double amount, int style)
>  {
>      current_module = "seek";
> -    if (demux_seek(mpctx->demuxer, amount, audio_delay, style) == 0)
> +    int dmxret = demux_seek(mpctx->demuxer, amount, audio_delay, style);
> +    if (mpctx->demuxer->video->eof) {
> +       mpctx->eof=1;
>         return -1;
> -
> +    }
> +    if (dmxret == 0) {
> +       return -1;
> +    }
> +    
>      if (mpctx->sh_video) {
>         current_module = "seek_video_reset";
>         resync_video_stream(mpctx->sh_video);

This breaks gcc 2.95.3.

Also, it can be done shorter:

     if (demux_seek(mpctx->demuxer, amount, audio_delay, style) == 0)
+    {
+        if (mpctx->demuxer->video->eof)
+            mpctx->eof = 1;
         return -1;
+    }

After that, one could commit a cosmetics change and put the { on the same 
line as the if-statement. Perhaps you can even do mpctx->eof += 
mpctx->demuxer->video->eof, but I am not familiar with the seeking code.

--Ivo



More information about the MPlayer-dev-eng mailing list