summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-02 22:35:00 +0200
committerwm4 <wm4@nowhere>2013-06-03 22:40:07 +0200
commit3913e3e383f2838c19c876ff1d809ac883014760 (patch)
tree7fd174c99cf104db006b7a71f18ee7f17ed5cce8 /sub/sd_ass.c
parent5e2c211a4e1d67748348295b191acb2dfb76d024 (diff)
downloadmpv-3913e3e383f2838c19c876ff1d809ac883014760.tar.bz2
mpv-3913e3e383f2838c19c876ff1d809ac883014760.tar.xz
sub: don't check for duplicates on sub conversion
This mirrors commit "sub: remove check_duplicate_plaintext_event()". That code was basically duplicated. In general, this code is still needed when doing conversion during demuxing (mostly because you can seek during demuxing, which will cause duplicate events by replaying).
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 21d941933c..7e863a2844 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -132,11 +132,13 @@ static void decode(struct sd *sd, struct demux_packet *packet)
return;
}
not_all_whitespace:;
- for (int i = 0; i < track->n_events; i++)
- if (track->events[i].Start == ipts
- && (duration <= 0 || track->events[i].Duration == iduration)
- && strcmp(track->events[i].Text, text) == 0)
- return; // We've already added this subtitle
+ if (!sd->no_remove_duplicates) {
+ for (int i = 0; i < track->n_events; i++)
+ if (track->events[i].Start == ipts
+ && (duration <= 0 || track->events[i].Duration == iduration)
+ && strcmp(track->events[i].Text, text) == 0)
+ return; // We've already added this subtitle
+ }
if (duration <= 0) {
iduration = 10000;
ctx->incomplete_event = true;