summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-20 20:47:30 +0200
committerwm4 <wm4@nowhere>2014-07-20 20:47:30 +0200
commit0248de84ea877a824910bb80c38a6ad2146085b8 (patch)
tree5ab700902a0cedf4edcabecf530fc87a20037fa5 /player
parentba621ac1404cd40f8ae367299180368016fb53bf (diff)
downloadmpv-0248de84ea877a824910bb80c38a6ad2146085b8.tar.bz2
mpv-0248de84ea877a824910bb80c38a6ad2146085b8.tar.xz
player: simplify a condition
Move a condition somewhere else, which makes it conceptually simpler. Also, the assignment to full_audio_buffers removed with this commit was dead, and its value never used.
Diffstat (limited to 'player')
-rw-r--r--player/playloop.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/player/playloop.c b/player/playloop.c
index a8965ba3d0..13df0277d9 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -1166,10 +1166,17 @@ void run_playloop(struct MPContext *mpctx)
!video_left)))
{
int status = fill_audio_out_buffers(mpctx, endpts);
- full_audio_buffers = status >= 0 && !ao_untimed(mpctx->ao);
// Not at audio stream EOF yet
audio_left = status > -2;
}
+ if (mpctx->d_audio) {
+ /* When all audio has been written to output driver, stay in the
+ * main loop handling commands until it has been mostly consumed,
+ * except in the gapless case, where the next file will be started
+ * while audio from the current one still remains to be played.
+ */
+ audio_left |= !ao_eof_reached(mpctx->ao) && !opts->gapless_audio;
+ }
if (!video_left)
mpctx->restart_playback = false;
@@ -1190,11 +1197,6 @@ void run_playloop(struct MPContext *mpctx)
* and video streams to "disabled" at runtime. Handle this by waiting
* rather than immediately stopping playback due to EOF.
*
- * When all audio has been written to output driver, stay in the
- * main loop handling commands until it has been mostly consumed,
- * except in the gapless case, where the next file will be started
- * while audio from the current one still remains to be played.
- *
* We want this check to trigger if we seeked to this position,
* but not if we paused at it with audio possibly still buffered in
* the AO. There's currently no working way to check buffered audio
@@ -1203,7 +1205,6 @@ void run_playloop(struct MPContext *mpctx)
* buffered.
*/
if ((mpctx->d_audio || mpctx->d_video) && !audio_left && !video_left
- && (opts->gapless_audio || !mpctx->d_audio || ao_eof_reached(mpctx->ao))
&& (!mpctx->paused || was_restart)) {
if (end_is_chapter) {
mp_seek(mpctx, (struct seek_params){