Hi Folks,<br>
<br>
VLS supports subtitles in VPlayer format, but it has a bug.<br>
This time-based format only specifies start time. Players<br>
are supposed to automatically remove subtitle after 3 seconds,<br>
but VLC doesn't do it. Sample discussion of the problem:<br>
<a href="http://forum.videolan.org/viewtopic.php?t=7663&highlight=vplayer&sid=5809b8234926cbdbf12bd8dbfa8df238">http://forum.videolan.org/viewtopic.php?t=7663&highlight=vplayer&sid=5809b8234926cbdbf12bd8dbfa8df238
</a><br>
<br>
I am not a programmer, but I have found this bug and have a fix.<br>
<br>
The issue is in subtitle demuxer at the following source file:<br>
<a href="http://trac.videolan.org/vlc/browser/trunk/modules/demux/subtitle.c">http://trac.videolan.org/vlc/browser/trunk/modules/demux/subtitle.c</a><br>
<br>
Procedure "ParseVplayer" (line 1038) should parse line from file<br>
and put correct start/stop time in variables i_start and i_end.<br>
<br>
i_start is found correctly in line 1074 and later copied<br>
to p_subtitle->i_start in line 1089.<br>
<br>
Bug is that p_subtitle->i_stop is set to "0" (never disappear).<br>
<br>
Fix: in line 1091 change i_stop to i_start + 3 seconds (I believe<br>
it will be 3000 units since you use milliseconds.<br>
<br>
Old:<br>
    p_subtitle->i_start = i_start;<br>
    p_subtitle->i_stop  = 0;<br>
<br>
New:<br>
    p_subtitle->i_start = i_start;<br>
    p_subtitle->i_stop  = i_start + 3000;<br>
<br>
<br>
If you want to make a better handling, you could make "3000" not<br>
a constant, but configuration variable that can be changed from<br>
GUI/CLI. I do not know VLC code enough to find how to do that.<br>
<br>
PS: it is also possible that other parser might have the same issue,<br>
so instead of treating i_stop == 0 as "never disappear" it could be<br>
changed to if (i_stop == 0) then (wait a FIXED_DELAY).<br>
IMVHO a better fix would be: "remove subtitle when the next appears<br>
or after 3 seconds if not" but this is more complex change that I can't<br>
fully make at the moment.<br>
<br>
FYI: sample VPLayer format subtitles (five lines):<br>
<br>
00:00:02:-One<br>
00:00:12:-Two<br>
00:00:13:-Three<br>
00:00:20:-Four<br>
00:00:21:-Five<br>
<br>
Best Regards,<br>
                              
Marek Moskal<br>