diff options
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/playback.c b/apps/playback.c index 0b67615700..63bf4dbc4f 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -392,7 +392,7 @@ void codec_advance_buffer_callback(long amount) | |||
392 | if (amount > cur_ti->available + cur_ti->filerem) | 392 | if (amount > cur_ti->available + cur_ti->filerem) |
393 | amount = cur_ti->available + cur_ti->filerem; | 393 | amount = cur_ti->available + cur_ti->filerem; |
394 | 394 | ||
395 | if (amount > cur_ti->available) { | 395 | if (amount > cur_ti->available && !filling) { |
396 | if (!rebuffer_and_seek(ci.curpos + amount)) | 396 | if (!rebuffer_and_seek(ci.curpos + amount)) |
397 | ci.stop_codec = true; | 397 | ci.stop_codec = true; |
398 | return ; | 398 | return ; |
@@ -1346,16 +1346,16 @@ static void initiate_track_change(int peek_index) | |||
1346 | if (!playlist_check(peek_index)) | 1346 | if (!playlist_check(peek_index)) |
1347 | return ; | 1347 | return ; |
1348 | 1348 | ||
1349 | new_track = peek_index; | ||
1350 | ci.reload_codec = true; | ||
1351 | |||
1352 | /* Detect if disk is spinning.. */ | 1349 | /* Detect if disk is spinning.. */ |
1353 | if (filling) { | 1350 | if (filling) { |
1354 | ci.stop_codec = true; | 1351 | ci.stop_codec = true; |
1355 | playlist_next(peek_index); | 1352 | playlist_next(peek_index); |
1356 | queue_post(&audio_queue, AUDIO_PLAY, 0); | 1353 | queue_post(&audio_queue, AUDIO_PLAY, 0); |
1357 | } else { | 1354 | } else { |
1358 | pcmbuf_crossfade_init(); | 1355 | new_track = peek_index; |
1356 | ci.reload_codec = true; | ||
1357 | if (!pcmbuf_is_crossfade_enabled()) | ||
1358 | pcmbuf_flush_audio(); | ||
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | codec_track_changed(); | 1361 | codec_track_changed(); |
@@ -1384,8 +1384,9 @@ void audio_thread(void) | |||
1384 | ci.stop_codec = true; | 1384 | ci.stop_codec = true; |
1385 | ci.reload_codec = false; | 1385 | ci.reload_codec = false; |
1386 | ci.seek_time = 0; | 1386 | ci.seek_time = 0; |
1387 | if (!pcmbuf_is_crossfade_active()) | 1387 | pcmbuf_crossfade_init(); |
1388 | pcmbuf_crossfade_init(); | 1388 | while (codec_loaded) |
1389 | yield(); | ||
1389 | audio_play_start((int)ev.data); | 1390 | audio_play_start((int)ev.data); |
1390 | playlist_update_resume_info(audio_current_track()); | 1391 | playlist_update_resume_info(audio_current_track()); |
1391 | break ; | 1392 | break ; |