summaryrefslogtreecommitdiffstats
path: root/mp_core.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-12-18 10:13:45 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-12-20 19:02:14 +0200
commit23f598e0ee2151923a44077f510cd484f239480b (patch)
treebd04338c6482db5c08d34d23a5aaf872701fc8a7 /mp_core.h
parentb9a3579ec980dfb01d0b952bf0b859ecdf62d7ea (diff)
downloadmpv-23f598e0ee2151923a44077f510cd484f239480b.tar.bz2
mpv-23f598e0ee2151923a44077f510cd484f239480b.tar.xz
core: add struct for queued seek info
To prepare for the addition of exact seek support, add a struct for queued seek state and a helper function to update its state. It would have been cumbersome to update additional state (showing whether the seek is forced to be exact or non-exact) manually at every point that handles seeks.
Diffstat (limited to 'mp_core.h')
-rw-r--r--mp_core.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/mp_core.h b/mp_core.h
index c02edd4155..c64de2cdbe 100644
--- a/mp_core.h
+++ b/mp_core.h
@@ -161,8 +161,15 @@ typedef struct MPContext {
unsigned int last_time;
// Used to communicate the parameters of a seek between parts
- double rel_seek_secs;
- int abs_seek_pos;
+ struct seek_params {
+ enum seek_type {
+ MPSEEK_NONE, MPSEEK_RELATIVE, MPSEEK_ABSOLUTE, MPSEEK_FACTOR
+ } type;
+ double amount;
+ int exact; // -1 = disable, 0 = default, 1 = enable
+ // currently not set by commands, only used internally by seek()
+ int direction; // -1 = backward, 0 = default, 1 = forward
+ } seek;
/* Heuristic for relative chapter seeks: keep track which chapter
* the user wanted to go to, even if we aren't exactly within the
@@ -225,6 +232,8 @@ int reinit_video_chain(struct MPContext *mpctx);
void pause_player(struct MPContext *mpctx);
void unpause_player(struct MPContext *mpctx);
void add_step_frame(struct MPContext *mpctx);
+void queue_seek(struct MPContext *mpctx, enum seek_type type, double amount,
+ int exact);
int seek_chapter(struct MPContext *mpctx, int chapter, double *seek_pts,
char **chapter_name);
double get_time_length(struct MPContext *mpctx);