summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-30 02:14:38 +0200
committerwm4 <wm4@nowhere>2014-05-30 02:16:43 +0200
commitc79689206c489b2ba449b8d21e0b5819298c949a (patch)
treefd3d19c60f34ce62396e1aa61cfa99005dc7f953 /player
parentb7c6981278067b22930c6193d79a6d96cb277143 (diff)
downloadmpv-c79689206c489b2ba449b8d21e0b5819298c949a.tar.bz2
mpv-c79689206c489b2ba449b8d21e0b5819298c949a.tar.xz
audio: change handling of an EOF corner case
This code handles buggy AOs (even if all AOs are bug-free, it's good for robustness). Move handling of it to the AO feed thread. Now this check doesn't require magic numbers and does exactly what's it supposed to do.
Diffstat (limited to 'player')
-rw-r--r--player/audio.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/player/audio.c b/player/audio.c
index a391aeabe5..1070270dda 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -459,13 +459,7 @@ int fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
int played = write_to_ao(mpctx, &data, playflags, written_audio_pts(mpctx));
assert(played >= 0 && played <= data.samples);
- if (played > 0) {
- mp_audio_buffer_skip(mpctx->ao_buffer, played);
- } else if (!mpctx->paused && audio_eof && ao_get_delay(ao) < .04) {
- // Sanity check to avoid hanging in case current ao doesn't output
- // partial chunks and doesn't check for AOPLAY_FINAL_CHUNK
- signal_eof = true;
- }
+ mp_audio_buffer_skip(mpctx->ao_buffer, played);
return signal_eof ? -2 : -partial_fill;
}