summaryrefslogtreecommitdiffstats
path: root/sub/dec_sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-05 23:55:56 +0100
committerwm4 <wm4@nowhere>2015-12-05 23:55:56 +0100
commitff1eaea3e7f9ac2ab45b298326b96d256f487dc3 (patch)
tree7b0f0f9bcaab6f080b73c11e5318e982d0c8aa42 /sub/dec_sub.c
parent9a240dc82e442a2f1d3d383c4b32f3eaab0a1f6a (diff)
downloadmpv-ff1eaea3e7f9ac2ab45b298326b96d256f487dc3.tar.bz2
mpv-ff1eaea3e7f9ac2ab45b298326b96d256f487dc3.tar.xz
sd_lavc: remove small gaps between subtitles
Just like with text subtitles. Move the magic constants to a common place too.
Diffstat (limited to 'sub/dec_sub.c')
-rw-r--r--sub/dec_sub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index 9261e2570d..a9267112f4 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -356,8 +356,8 @@ static void multiply_timings(struct packet_list *subs, double factor)
// overlapping lines. (It's not worth the trouble.)
static void fix_overlaps_and_gaps(struct packet_list *subs)
{
- double threshold = 0.2; // up to 200 ms overlaps or gaps are removed
- double keep = threshold * 2;// don't change timings if durations are smaller
+ double threshold = SUB_GAP_THRESHOLD;
+ double keep = SUB_GAP_KEEP;
for (int i = 0; i < subs->num_packets - 1; i++) {
struct demux_packet *cur = subs->packets[i];
struct demux_packet *next = subs->packets[i + 1];