summaryrefslogtreecommitdiffstats
path: root/sub/filter_sdh.c
diff options
context:
space:
mode:
authorDan Oscarsson <DanOscarsson@users.noreply.github.com>2017-04-15 16:19:31 +0200
committerwm4 <wm4@nowhere>2017-04-15 16:38:38 +0200
commit1a0c340a5ed6d33c5c8f4e661a8d891637c3fdf7 (patch)
tree5125b4a13c3d11f92d3d3ba9e395bbee26779e8a /sub/filter_sdh.c
parentbbfafb5614594f4ec152e3392235ca2622c1240a (diff)
downloadmpv-1a0c340a5ed6d33c5c8f4e661a8d891637c3fdf7.tar.bz2
mpv-1a0c340a5ed6d33c5c8f4e661a8d891637c3fdf7.tar.xz
sub: minor sdh filter fixes
When doing harder filtering not require a space after : results in lines with a clock (like 10:05) to be taken as a speaker label. So require a space after : even when doing harder filtering as missing space is very uncommon. Some like to add text in parentheses in the speaker label, like XXX (loud): or just (loud): allow parentheses when doing harder filtering
Diffstat (limited to 'sub/filter_sdh.c')
-rw-r--r--sub/filter_sdh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sub/filter_sdh.c b/sub/filter_sdh.c
index 1881ee0d2c..92359786d1 100644
--- a/sub/filter_sdh.c
+++ b/sub/filter_sdh.c
@@ -132,6 +132,7 @@ static void skip_speaker_label(struct sd *sd, char **rpp, struct buffer *buf)
(filter_harder || mp_isupper(rp[0]) || rp[0] == 'l')) ||
mp_isdigit(rp[0]) ||
rp[0] == ' ' || rp[0] == '\'' ||
+ (filter_harder && (rp[0] == '(' || rp[0] == ')')) ||
rp[0] == '#' || rp[0] == '.' || rp[0] == ',') {
rp++;
} else {
@@ -151,7 +152,7 @@ static void skip_speaker_label(struct sd *sd, char **rpp, struct buffer *buf)
} else if (rp[0] == '\\' && rp[1] == 'N') {
// line end follows - skip it as line is empty
rp += 2;
- } else if (rp[0] == ' ' || filter_harder) {
+ } else if (rp[0] == ' ') {
while (rp[0] == ' ') {
rp++;
}