[MPlayer-dev-eng] [PATCH] Two small subtitles improvments
Clément Bœsch
ubitux at gmail.com
Thu Sep 30 00:33:38 CEST 2010
On Thu, Sep 30, 2010 at 12:16:55AM +0200, Clément Bœsch wrote:
> - patch-rt-format.diff
>
> Explicit recognition for the RealTime format. I made a Google research
> ("time begin ext:rt"), and fetched all the subtitles (not that much, 28).
> I only ran into two "headers": "<window" and "<WINDOW" so I think it's
> fine to rely on it. Even if there were no white spaces before, I used
> strstr() function, just in case.
I didn't see stristr() function at first. Patch updated.
--
Clément B.
-------------- next part --------------
Index: subreader.c
===================================================================
--- subreader.c (revision 32412)
+++ subreader.c (working copy)
@@ -1130,13 +1129,8 @@
{*uses_time=1;return SUB_VPLAYER;}
if (sscanf (line, "%d:%d:%d ", &i, &i, &i )==3)
{*uses_time=1;return SUB_VPLAYER;}
- //TODO: just checking if first line of sub starts with "<" is WAY
- // too weak test for RT
- // Please someone who knows the format of RT... FIX IT!!!
- // It may conflict with other sub formats in the future (actually it doesn't)
- if ( *line == '<' )
+ if (stristr (line, "<window"))
{*uses_time=1;return SUB_RT;}
-
if (!memcmp(line, "Dialogue: Marked", 16))
{*uses_time=1; return SUB_SSA;}
if (!memcmp(line, "Dialogue: ", 10))
More information about the MPlayer-dev-eng
mailing list