From f8a1bd1253fdc6076415e67e006ab99a2cae568e Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 27 Aug 2014 23:12:24 +0200 Subject: player: dynamically change cache wait times Remove the hardcoded wait time of 2 seconds. Instead, adjust the wait time each time we unpause: if downloading the data took longer than its estimated playback time, increase the amount of data we wait for. If it's shorter, decrease it. The +/- is supposed to avoid oscillating between two values if the elapsed time and the wait time are similar. It's not sure if this actually helps with anything, but it can't harm. --- player/core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'player/core.h') diff --git a/player/core.h b/player/core.h index fb335851d9..341ea84c47 100644 --- a/player/core.h +++ b/player/core.h @@ -345,6 +345,7 @@ typedef struct MPContext { bool playing_msg_shown; bool paused_for_cache; + double cache_stop_time, cache_wait_time; // Set after showing warning about decoding being too slow for realtime // playback rate. Used to avoid showing it multiple times. -- cgit v1.2.3