summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-19 22:01:30 +0200
committerwm4 <wm4@nowhere>2016-04-19 22:01:30 +0200
commit8db9206c54cb2208178e23e21961545741810a9f (patch)
tree82d5c52f5f42acad631c10c405332cb0c4e88022 /player/core.h
parent503dada42f1ea1007768da0dc6a41b67cdf89400 (diff)
downloadmpv-8db9206c54cb2208178e23e21961545741810a9f.tar.bz2
mpv-8db9206c54cb2208178e23e21961545741810a9f.tar.xz
player: simplify an aspect of buffering determination
Calculate the buffering percentage in the same code which determines whether the player is or should be buffering. In particular it can't happen that percentage and buffering state are slightly out of sync due to calling DEMUXER_CTRL_GET_READER_STATE and reusing it with the previously determined buffering state. Now it's also easier to guarantee that the buffering state is updated properly. Add some more verbose output as well. (Damn I hate this code, why did I write it?)
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/core.h b/player/core.h
index 21129d6ea3..489d1f8d3f 100644
--- a/player/core.h
+++ b/player/core.h
@@ -398,6 +398,7 @@ typedef struct MPContext {
bool paused_for_cache;
double cache_stop_time, cache_wait_time;
+ int cache_buffer;
// Set after showing warning about decoding being too slow for realtime
// playback rate. Used to avoid showing it multiple times.
@@ -515,7 +516,7 @@ char *chapter_display_name(struct MPContext *mpctx, int chapter);
char *chapter_name(struct MPContext *mpctx, int chapter);
double chapter_start_time(struct MPContext *mpctx, int chapter);
int get_chapter_count(struct MPContext *mpctx);
-double get_cache_buffering_percentage(struct MPContext *mpctx);
+int get_cache_buffering_percentage(struct MPContext *mpctx);
void execute_queued_seek(struct MPContext *mpctx);
void run_playloop(struct MPContext *mpctx);
void mp_idle(struct MPContext *mpctx);