[Webkit-unassigned] [Bug 55217] [GStreamer] Frame accurate seeking isn't always accurate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 14 16:13:03 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=55217





--- Comment #8 from Philippe Normand <pnormand at igalia.com>  2011-03-14 16:13:02 PST ---
(In reply to comment #7)
> 
> I think you should probably just dispense with the microseconds variable altogether and rename microsecondsf to microseconds.
> 

Agreed.

> float seconds;
> float microseconds = modf(time, &seconds) * 1000000;
> timeValue.tv_sec = static_cast<glong>(seconds);
> timeValue.tv_usec = static_cast<glong>(roundf(microSecondsf / 10000) * 10000);
> 
> I'm still a bit confused by this logic, because you multiply microsecondsf by 1000000 and then immediately divide by 10000.

An example of time is 2.155999 seconds. modf() will return 0.155999 seconds. So to get the microseconds value we multiply by 1000000.

The division and multiplication are used to round. If microseconds is something like 155999:

roundf(15.5999) * 10000 = 160000 microseconds

I'll have another look at this tomorrow morning, thanks for the review anyway :)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list