[vlc] Bug found (v1.0.0) - Rewind in WebPlugin

Peter Waher Peter.Waher at weevio.com
Tue Jul 21 09:47:32 CEST 2009


Hello.

I've found a bug in the WebPlugin (v1.0.0), related to the rewind function. When setting the input.rate property to -2.0, the video fastforwards very quickly to the end (as if it interpreted the negative value as a very big positive value).

The following code does not work. The first time it is called it sets Control.input.rate to -2.0, which results in a very quick fast forward:

function MediaFastBackward(Sender)
{
   var Control;

   try
   {
      Debug("Fast Backward");

      Control = GetMediaElement();
      if (Control != null)
      {
         var Rate = Control.input.rate;

         if (isNaN(Rate) || Rate >= 0)
            Rate = -2.0;
         else if (Rate <= -32)
            Rate = -32;
         else
            Rate *= 2.0;

         Control.input.rate = Rate;
      }
   }
   catch (e)
   {
      HandleClientException(e, "MediaFastBackward");
   }
}


The following code works fine. It sets the rate to 2.0, 4.0, 8.0, etc., for each time it is called:

function MediaFastForward(Sender)
{
   var Control;

   try
   {
      Debug("Fast Forward");

      Control = GetMediaElement();
      if (Control != null)
      {
         var Rate = Control.input.rate;

         if (isNaN(Rate) || Rate <= 0)
            Rate = 2.0;
         else if (Rate <= 16)
            Rate *= 2.0;
         else
            Rate = 32.0;

         Control.input.rate = Rate;
      }
   }
   catch (e)
   {
      HandleClientException(e, "MediaFastForward");
   }
}

Thank you in advance,
Peter Waher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc/attachments/20090721/07c1d1e4/attachment.html>


More information about the vlc mailing list