summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-10-21 17:07:07 +0200
committerwm4 <wm4@nowhere>2016-10-21 17:11:26 +0200
commitf64de3ea6659e6fe459700d1d03917990eb9d84a (patch)
treea1ad9d1e30119b65091a70d9b3f932173950c61d /player/playloop.c
parent61a51c57a9aae865930b4cc69a1480218e374404 (diff)
downloadmpv-f64de3ea6659e6fe459700d1d03917990eb9d84a.tar.bz2
mpv-f64de3ea6659e6fe459700d1d03917990eb9d84a.tar.xz
player: don't leave buffering during underflow
Don't leave the buffering state while the demuxer is still marked as having underflowed. It's unclear why this hasn't been done before - with the logic being complicated as it is, maybe there was a reason for this. This is actually still not very reliable, but should be better than what was before: on stream switching decoders can read packets all while the demuxer is executing a refresh seek, which creates the underrun situation - but nothing really totally guarantees that the underrun state remains stable when the demuxer is back at the current demuxer position. Anyway, it's an improvement. The rest of the touched condition is not changed, just moved around for cosmetic reasons.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 934b8ff0d9..4616db0744 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -608,8 +608,8 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx)
if (mpctx->restart_complete && c.size > 0) {
if (mpctx->paused && mpctx->paused_for_cache) {
- if (!opts->cache_pausing || s.ts_duration >= mpctx->cache_wait_time
- || s.idle)
+ if (!s.underrun && (!opts->cache_pausing || s.idle ||
+ s.ts_duration >= mpctx->cache_wait_time))
{
double elapsed_time = now - mpctx->cache_stop_time;
if (elapsed_time > mpctx->cache_wait_time) {