Found my answer... no time information available from VLC for TS files. So, disregard!
On VLC 1.2 or later, you can get the length(ms) and get current time(ms).
I worked for this future and already it was committed to the trunk tree (1.2.0 or later).
how to calculate and set correct position of vlc player? the formular tpos seam wrong, when I click it seem jump random, and can not move back to first position (some kind of shift forward only).
If you want to calculate correct time and length of MPEG-TS video file, it is not easy.
Because there is no information in stream headers to estimate bitrate or duration.
So, you must parse whole file, at least first and last few packets, to get the duration.
And you cannot get correct time position by the formula:
current_position = stream_position_rate * stream_length
The correlation between time and position is not completely linear.
I don't know anything about AutoIt, but anyway your code seems wrong.
- What is a inittime?
- What is a result of _GUICtrlSlider_GetPos()? a rate(0.0-1.0), a time, a integer(0-1000), or something else?
- What is a result of VLCcmd('get_length')? a time? and a value is not zero? VLC 1.1 always returns zero.
- Does VLCcmd('seek') accept a time as parameter? Generally it's a rate (between 0.0 to 1.0).
If there are commands like VLCcmd('get_time'), you can get more accurate position by the formula:
current_position = get_time / get_length
Of course, you need VLC 1.2.0 or later to get current time and length from MPEG-TS. VLC 1.1 cannot get them.
Maybe, it's time to switch VLC 1.2.0
And I don't know AutoIt supports VLC 1.2.0 or later now
How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html
My hack for ISDB-T http://sdrv.ms/126weue