1
0
Fork 0
forked from len0rd/rockbox

Fix potential stuck on auto track change when buffering is stopped

pcmbuf  might wait for next track for proper crossfade/gapeless playback (see pcmbuf_start_track_change). It's not going to happen with stopped buffering.

Fixup for 831faa3b (#5394)

Change-Id: I969878d13a9f976566eef5b975beb1687b519a37
This commit is contained in:
roman.artiukhin 2023-11-01 11:21:59 +02:00
parent 11b8336c64
commit 63f75d22b4

View file

@ -2690,12 +2690,18 @@ static void audio_on_codec_complete(int status)
struct track_info info;
bool have_track = track_list_advance_current(1, &info);
if (!have_track || (info.audio_hid < 0 && filling != STATE_STOPPED))
if (!have_track || info.audio_hid < 0)
{
bool end_of_playlist = false;
if (have_track)
{
if (filling == STATE_STOPPED)
{
audio_begin_track_change(TRACK_CHANGE_END_OF_DATA, trackstat);
return;
}
/* Track load is not complete - it might have stopped on a
full buffer without reaching the audio handle or we just
arrived at it early