Page 1 of 1

wrong time & length in web interface

Posted: 04 Oct 2006 23:54
by igorh
Hi, i'm using the VLM web interface of vlc (version 8.5) and the times reported in the broadcasts is incorrect. It's reported correctly in the VLM gui interface, but it seems that the integers are overflowing in the web ui. has anyone else come accross this? any fixes or workarounds? I've searched around and haven't found anything.

Thanks in advance
-igor

Posted: 06 Oct 2006 15:22
by dionoea
Any simple way to reproduce this ?

creating a broadcast of a long video file will cause it

Posted: 06 Oct 2006 16:45
by igorh
If you create a broadcast in VLM with a file that's pretty large (say 2.5 hours or larger) and start playing it, you will see this.

if you look at the broadcast in the Windows GUI, it will have the correct time. If you look at the broadcast in the web-based (http://host:8080/vlm.html) interface, you will see that the times are incorrect.

(and if you look at the XML being returned in something like a packet sniffer, like Ethereal, you will see that sometimes the times are being returned as negative values). The telnet interface aslo returns the wrong length.

For instance, a broadcast of a 25 minute .mpg has length: 1,500,567,588
a broadcast of 2 hours, 38 minute .mpg has length: 917,578,977

Thanks again,
-igor

Posted: 07 Oct 2006 13:00
by dionoea
ok, thanks. I'll fix that.

Posted: 16 Oct 2006 21:04
by eclip5e
Was this filed as a bug in Trac? Could we get the Bug number so we could follow the status? It would also help as to where in the codebase this bug is happening.

thanks.

Posted: 17 Oct 2006 15:44
by dionoea
Nope ... i forgot about it :) You can fill a ticket in trac to be sure that i don't forget once more ...

Posted: 17 Oct 2006 15:59
by eclip5e
Which component should we file it under?

Due to some deadlines, we would need a fix for this ASAP (In the next week or 2). Where in the code is this problem, perhaps we could file a bug fix.

Posted: 17 Oct 2006 16:02
by dionoea
I can't give you any time estimate :) I do this durring my free time (and for free).

You can file the bug under "HTTP interface" or any equivalent category in trac. Source code for the http interface is in modules/control/http/

Posted: 17 Oct 2006 18:31
by eclip5e
I can't give you any time estimate :) I do this durring my free time (and for free).

You can file the bug under "HTTP interface" or any equivalent category in trac. Source code for the http interface is in modules/control/http/
Thanks for the help,

If we could find where the problem occurs, we could send in a bug fix. We don't care who fixes it, just as long as we can use it, since another piece of our project relies on this functionality.

I filed this as bug 779 here: https://trac.videolan.org/vlc/ticket/779

Posted: 17 Oct 2006 21:20
by eclip5e
Could the problem be casting a number that is too large into an int?

http://trac.videolan.org/vlc/browser/tr ... ttp.c#L522

Code: Select all

var_Get( p_sys->p_input, "time", &val); sprintf( time, "%d" , (int)(val.i_time / 1000000) );

Posted: 17 Oct 2006 22:05
by dionoea
Yes, that's exactly what i was thinking about.

Posted: 17 Oct 2006 22:06
by dionoea
but it's not position that we have a problem with :) (position is a percentage, it can't overflow)

Posted: 17 Oct 2006 22:07
by eclip5e
Sorry, I meant this:

Code: Select all

var_Get( p_sys->p_input, "time", &val); sprintf( time, "%d" , (int)(val.i_time / 1000000) );
Any suggestions? (I don't code c).

Posted: 17 Oct 2006 22:16
by dionoea
Should be fixed ( https://trac.videolan.org/vlc/changeset/17130 ) in 0.9.0 svn.

Posted: 17 Oct 2006 22:39
by eclip5e
Great, thanks! Would you mark the bug as fixed, and wait for a tirage period?

Posted: 17 Oct 2006 22:59
by dionoea
You should give it a try first.

Posted: 18 Oct 2006 18:56
by eclip5e
I talked to a few guys on IRC about problems with the win32 nightlies, and finally got the new trunk build as of this morning: 0.9.0-svn-20061018-1453.

I tested it on a 2 hour broadcast, and the time failed again, resulting in a negative value.

Code: Select all

<instance name="default" state="playing" position="0.733578" time="-1097172696" length="1162361200" rate="1000" title="0" chapter="0" seekable="1" playlistindex="1"/>
Looks like the change didn't fix the problem:
http://trac.videolan.org/vlc/changeset/ ... ttp/http.c

Posted: 18 Oct 2006 23:16
by dionoea
Ok, this problem isn't http interface specific. Time reported in the telnet interface was wrong too. It should now be fixed.

Posted: 19 Oct 2006 17:52
by eclip5e
W00t! Fixed.

Thanks to dionoea for the quick turnaround on this, its helped with our project a lot!

Fix part 1: https://trac.videolan.org/vlc/changeset/17130
Fix part 2: https://trac.videolan.org/vlc/changeset/17140

What is the bug triage process to set fixed/closed/verified for bug #779?
https://trac.videolan.org/vlc/ticket/779

Posted: 19 Oct 2006 22:37
by dionoea
I closed the ticket.