[MPlayer-dev-eng] [PATCH] SAMI subtitle files (subreader.c)
Bruno Lecointre
bruno-lecointre at pacbell.net
Sun Aug 24 00:06:31 CEST 2003
Hi,
here is a small patch to subreader.c to allow mplayer to read SAMI
subtitle files in which the sync tag is all upper case. I have found
quite a number of files in which the syntax is "START=" and not "Start="
as the current code in mplayer looks for. Apparently the comment in the
code says we should look for "START=" but the code looks for "Start="
and is case sensitive.
This small patch makes the code look for both.
Bruno
-------------- next part --------------
--- subreader.c 2003-08-21 02:34:32.000000000 -0700
+++ subreader.c.new 2003-08-20 01:35:20.000000000 -0700
@@ -96,9 +96,11 @@
if (slacktime_s)
sub_slacktime = strtol (slacktime_s+10, NULL, 0) / 10;
- s = strstr (s, "Start=");
- if (s) {
- current->start = strtol (s + 6, &s, 0) / 10;
+ q = strstr (s, "Start=");
+ if (!q)
+ q = strstr (s, "START=");
+ if (q) {
+ current->start = strtol (q + 6, &q, 0) / 10;
state = 1; continue;
}
break;
@@ -132,6 +134,8 @@
case 4: /* get current->end or skip <TAG> */
q = strstr (s, "Start=");
+ if (!q)
+ q = strstr (s, "START=");
if (q) {
current->end = strtol (q + 6, &q, 0) / 10 - 1;
*p = '\0'; trail_space (text);
More information about the MPlayer-dev-eng
mailing list