summaryrefslogtreecommitdiffstats
path: root/sub/dec_sub.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/dec_sub.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/dec_sub.c')
-rw-r--r--sub/dec_sub.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index ec9af94abb..7e4427a40f 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -121,6 +121,10 @@ static void read_sub_data(struct dec_sub *sub, struct sub_data *subdata)
assert(sub_accept_packets_in_advance(sub));
char *temp = NULL;
+ struct sd *sd = sub_get_last_sd(sub);
+
+ sd->no_remove_duplicates = true;
+
for (int i = 0; i < subdata->sub_num; i++) {
subtitle *st = &subdata->subtitles[i];
// subdata is in 10 ms ticks, pts is in seconds
@@ -161,7 +165,6 @@ static void read_sub_data(struct dec_sub *sub, struct sub_data *subdata)
sub_decode(sub, &pkt);
}
- struct sd *sd = sub_get_last_sd(sub);
// Hack for broken FFmpeg packet format: make sd_ass keep the subtitle
// events on reset(), even though broken FFmpeg ASS packets were received
// (from sd_lavc_conv.c). Normally, these events are removed on seek/reset,
@@ -169,6 +172,8 @@ static void read_sub_data(struct dec_sub *sub, struct sub_data *subdata)
if (sd && sd->driver->fix_events)
sd->driver->fix_events(sd);
+ sd->no_remove_duplicates = false;
+
talloc_free(temp);
}