summaryrefslogtreecommitdiffstats
path: root/bstr.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-04-16 23:00:19 +0200
committerUoti Urpala <uau@mplayer2.org>2012-04-17 01:27:22 +0300
commitf0ce95607f566d288674f317176c51bcda026a9d (patch)
tree81696806891d06fb7de50e55dd32a86117d965e7 /bstr.c
parentaadf1002f8aa3a5813fd13ad18b8907b82068811 (diff)
downloadmpv-f0ce95607f566d288674f317176c51bcda026a9d.tar.bz2
mpv-f0ce95607f566d288674f317176c51bcda026a9d.tar.xz
subassconvert: handle unquoted attributes in subrip font tags
Previously, mplayer didn't convert tags like <font color=#00FF00>. But such subtitles exist in the wild, and should be handled.
Diffstat (limited to 'bstr.c')
-rw-r--r--bstr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bstr.c b/bstr.c
index 0c46b1d9b0..2ce5f6787e 100644
--- a/bstr.c
+++ b/bstr.c
@@ -185,6 +185,14 @@ struct bstr *bstr_splitlines(void *talloc_ctx, struct bstr str)
return r;
}
+bool bstr_eatstart(struct bstr *s, struct bstr prefix)
+{
+ if (!bstr_startswith(*s, prefix))
+ return false;
+ *s = bstr_cut(*s, prefix.len);
+ return true;
+}
+
void bstr_lower(struct bstr str)
{
for (int i = 0; i < str.len; i++)