summaryrefslogtreecommitdiffstats
path: root/mp_core.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 23:20:34 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 23:29:46 +0300
commitd2e25a90c40c47b97becaa6eaefa16e61f7f0cdf (patch)
tree162222a56f82b8d264744725e81f4adf898778c0 /mp_core.h
parent823b989f0f6e981b1ee61543573c391ca475dd18 (diff)
downloadmpv-d2e25a90c40c47b97becaa6eaefa16e61f7f0cdf.tar.bz2
mpv-d2e25a90c40c47b97becaa6eaefa16e61f7f0cdf.tar.xz
core: track current chapter for relative chapter seeks
Due to inexact seeks, chapter seek commands may result in a playback position that's inside the previous chapter. This causes problems when the user does repeated next-chapter/previous-chapter seeks, because the code will use the wrong base for calculating 'next' or 'previous'. Improve the behavior by adding a heuristic that keeps track of what chapter the user last wanted to seek to and adjusts the "current chapter" value based on that.
Diffstat (limited to 'mp_core.h')
-rw-r--r--mp_core.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/mp_core.h b/mp_core.h
index 5c0b48d285..1a01109307 100644
--- a/mp_core.h
+++ b/mp_core.h
@@ -154,6 +154,12 @@ typedef struct MPContext {
double rel_seek_secs;
int abs_seek_pos;
+ /* Heuristic for relative chapter seeks: keep track which chapter
+ * the user wanted to go to, even if we aren't exactly within the
+ * boundaries of that chapter due to an inaccurate seek. */
+ int last_chapter_seek;
+ double last_chapter_pts;
+
float begin_skip; ///< start time of the current skip while on edlout mode
// audio is muted if either EDL or user activates mute
short edl_muted; ///< Stores whether EDL is currently in muted mode.