gst/subparse/gstsubparse.c: Strip trailing newlines from subtitle text output.
Original commit message from CVS: * gst/subparse/gstsubparse.c: (strip_trailing_newlines), (parse_subrip): Strip trailing newlines from subtitle text output.
This commit is contained in:
parent
b9063640e5
commit
d39d9c68f3
@ -1,3 +1,9 @@
|
|||||||
|
2006-10-19 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst/subparse/gstsubparse.c: (strip_trailing_newlines),
|
||||||
|
(parse_subrip):
|
||||||
|
Strip trailing newlines from subtitle text output.
|
||||||
|
|
||||||
2006-10-18 Tim-Philipp Müller <tim at centricular dot net>
|
2006-10-18 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/subparse/gstsubparse.c: (gst_sub_parse_dispose),
|
* gst/subparse/gstsubparse.c: (gst_sub_parse_dispose),
|
||||||
|
@ -476,6 +476,20 @@ parse_mdvdsub (ParserState * state, const gchar * line)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
strip_trailing_newlines (gchar * txt)
|
||||||
|
{
|
||||||
|
if (txt) {
|
||||||
|
guint len;
|
||||||
|
|
||||||
|
len = strlen (txt);
|
||||||
|
while (len > 1 && txt[len - 1] == '\n') {
|
||||||
|
txt[len - 1] = '\0';
|
||||||
|
--len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* we want to escape text in general, but retain basic markup like
|
/* we want to escape text in general, but retain basic markup like
|
||||||
* <i></i>, <u></u>, and <b></b>. The easiest and safest way is to
|
* <i></i>, <u></u>, and <b></b>. The easiest and safest way is to
|
||||||
* just unescape a white list of allowed markups again after
|
* just unescape a white list of allowed markups again after
|
||||||
@ -572,6 +586,7 @@ parse_subrip (ParserState * state, const gchar * line)
|
|||||||
g_string_truncate (state->buf, 0);
|
g_string_truncate (state->buf, 0);
|
||||||
state->state = 0;
|
state->state = 0;
|
||||||
subrip_unescape_formatting (ret);
|
subrip_unescape_formatting (ret);
|
||||||
|
strip_trailing_newlines (ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user