summaryrefslogtreecommitdiffstats
path: root/player/misc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-18 20:40:23 +0200
committerwm4 <wm4@nowhere>2016-08-18 20:40:23 +0200
commita1dec6f54a31180968d3c8e5012bb3ccd1a7c716 (patch)
treedeb9ec2f90411e42d7b5e5015f4a491ac4553c18 /player/misc.c
parentbbcd0b6a03e2ff4c70c2923db84467fbdddce17e (diff)
downloadmpv-a1dec6f54a31180968d3c8e5012bb3ccd1a7c716.tar.bz2
mpv-a1dec6f54a31180968d3c8e5012bb3ccd1a7c716.tar.xz
player: make looping slightly more seamless
This affects A-B loops and --loop-file, and audio. Instead of dropping audio by resetting the AO, try to make it seamless by not sending data after the loop point, and after the seek send new data without a reset.
Diffstat (limited to 'player/misc.c')
-rw-r--r--player/misc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/player/misc.c b/player/misc.c
index a9174c41a9..bd65fb9d5b 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -90,6 +90,12 @@ double get_play_end_pts(struct MPContext *mpctx)
if (cend != MP_NOPTS_VALUE && (end == MP_NOPTS_VALUE || cend < end))
end = cend;
}
+ if (mpctx->ab_loop_clip && opts->ab_loop[1] != MP_NOPTS_VALUE &&
+ opts->ab_loop[1] > opts->ab_loop[0])
+ {
+ if (end == MP_NOPTS_VALUE || end > opts->ab_loop[1])
+ end = opts->ab_loop[1];
+ }
return end;
}