core: Clean up move-to-next-file logic
commit8ea7eb77fc7ba8bd0b596ea32ee60909a012828f
authorUoti Urpala <uau@symbol.nonexistent.invalid>
Wed, 13 Aug 2008 05:06:26 +0000 (13 08:06 +0300)
committerUoti Urpala <uau@symbol.nonexistent.invalid>
Wed, 13 Aug 2008 05:06:26 +0000 (13 08:06 +0300)
tree6d997337d31fe3577a66df3bb5a4c87b3b26fccc
parente107cf785132418cc658e1cee4ad814e17eac886
core: Clean up move-to-next-file logic

The mpctx->eof field was used to also store other reasons to stop
playing the current file besides EOF, and the code didn't properly
distinguish those from EOF. Rename the field to "stop_play" and clean
up some of the code accessing it. Properly separating EOF from other
reasons allows handling file switching better.

Before this commit buffered audio was always drained before moving to
the next file (the only exception when it was NOT drained when
stopping a file was when quitting the player completely). This added
an extra delay when manually moving to the next file as you had to
wait for the currently buffered audio to finish playing before the
next file would start. After this commit audio is only drained if the
file reaches EOF normally; otherwise audio is cut and the next file
starts immediately.
command.c
mp_core.h
mplayer.c