diff options
author | William Wilgus <wilgus.william@gmail.com> | 2023-09-21 10:37:29 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2023-09-23 00:52:38 -0400 |
commit | fcc82dfdca470e49d864da9af4fa9573ad6e54fe (patch) | |
tree | 588e9f63fa321d87567035a136bbd5328ea3b47d /apps/playback.c | |
parent | a45204f5df18843674c8072f95817e24aed4ff27 (diff) | |
download | rockbox-fcc82dfdca470e49d864da9af4fa9573ad6e54fe.tar.gz rockbox-fcc82dfdca470e49d864da9af4fa9573ad6e54fe.zip |
[BugFix] REPEAT_ONE manual track skip
Still having problems with determining the type of track change
lets try just watching the audio_next/prev functions
Change-Id: Ie4233ff4d4bf49792a6549d7bcd169ff4b1afd20
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/apps/playback.c b/apps/playback.c index e0cd2c94a1..9d5a6569ae 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -315,6 +315,8 @@ static unsigned int track_event_flags = TEF_NONE; /* (A, O-) */ | |||
315 | /* Pending manual track skip offset */ | 315 | /* Pending manual track skip offset */ |
316 | static int skip_offset = 0; /* (A, O) */ | 316 | static int skip_offset = 0; /* (A, O) */ |
317 | 317 | ||
318 | static bool track_skip_is_manual = false; | ||
319 | |||
318 | /* Track change notification */ | 320 | /* Track change notification */ |
319 | static struct | 321 | static struct |
320 | { | 322 | { |
@@ -2574,9 +2576,9 @@ static void audio_begin_track_change(enum pcm_track_change_type type, | |||
2574 | /* Even if the new track is bad, the old track must be finished off */ | 2576 | /* Even if the new track is bad, the old track must be finished off */ |
2575 | pcmbuf_start_track_change(type); | 2577 | pcmbuf_start_track_change(type); |
2576 | 2578 | ||
2577 | bool auto_skip = type != TRACK_CHANGE_MANUAL; | 2579 | track_skip_is_manual = (type == TRACK_CHANGE_MANUAL); |
2578 | 2580 | ||
2579 | if (!auto_skip) | 2581 | if (track_skip_is_manual) |
2580 | { | 2582 | { |
2581 | /* Manual track change happens now */ | 2583 | /* Manual track change happens now */ |
2582 | audio_finalise_track_change(); | 2584 | audio_finalise_track_change(); |
@@ -2595,9 +2597,9 @@ static void audio_begin_track_change(enum pcm_track_change_type type, | |||
2595 | return; | 2597 | return; |
2596 | 2598 | ||
2597 | /* Everything needed for the codec is ready - start it */ | 2599 | /* Everything needed for the codec is ready - start it */ |
2598 | if (audio_start_codec(auto_skip)) | 2600 | if (audio_start_codec(!track_skip_is_manual)) |
2599 | { | 2601 | { |
2600 | if (!auto_skip) | 2602 | if (track_skip_is_manual) |
2601 | playing_id3_sync(&info, -1, -1); | 2603 | playing_id3_sync(&info, -1, -1); |
2602 | return; | 2604 | return; |
2603 | } | 2605 | } |
@@ -2924,6 +2926,7 @@ static void audio_stop_playback(void) | |||
2924 | 2926 | ||
2925 | skip_pending = TRACK_SKIP_NONE; | 2927 | skip_pending = TRACK_SKIP_NONE; |
2926 | track_event_flags = TEF_NONE; | 2928 | track_event_flags = TEF_NONE; |
2929 | track_skip_is_manual = false; | ||
2927 | 2930 | ||
2928 | /* Close all tracks and mark them NULL */ | 2931 | /* Close all tracks and mark them NULL */ |
2929 | remove_event(BUFFER_EVENT_REBUFFER, buffer_event_rebuffer_callback); | 2932 | remove_event(BUFFER_EVENT_REBUFFER, buffer_event_rebuffer_callback); |
@@ -2999,6 +3002,11 @@ static void audio_on_skip(void) | |||
2999 | /* Manual skip */ | 3002 | /* Manual skip */ |
3000 | track_event_flags = TEF_NONE; | 3003 | track_event_flags = TEF_NONE; |
3001 | 3004 | ||
3005 | if (toskip == 1 && global_settings.repeat_mode == REPEAT_ONE) | ||
3006 | { | ||
3007 | audio_reset_and_rebuffer(TRACK_LIST_KEEP_CURRENT, 1); | ||
3008 | } | ||
3009 | |||
3002 | /* If there was an auto skip in progress, there will be residual | 3010 | /* If there was an auto skip in progress, there will be residual |
3003 | advancement of the playlist and/or track list so compensation will be | 3011 | advancement of the playlist and/or track list so compensation will be |
3004 | required in order to end up in the right spot */ | 3012 | required in order to end up in the right spot */ |
@@ -3049,7 +3057,7 @@ static void audio_on_skip(void) | |||
3049 | track_list_delta += d; | 3057 | track_list_delta += d; |
3050 | } | 3058 | } |
3051 | } | 3059 | } |
3052 | 3060 | track_skip_is_manual = false; | |
3053 | /* Adjust things by how much the playlist was manually moved */ | 3061 | /* Adjust things by how much the playlist was manually moved */ |
3054 | playlist_peek_offset -= playlist_delta; | 3062 | playlist_peek_offset -= playlist_delta; |
3055 | 3063 | ||
@@ -3750,10 +3758,11 @@ void audio_resume(void) | |||
3750 | audio_queue_send(Q_AUDIO_PAUSE, false); | 3758 | audio_queue_send(Q_AUDIO_PAUSE, false); |
3751 | } | 3759 | } |
3752 | 3760 | ||
3753 | /* Internal function used by REPEAT_ONE */ | 3761 | /* Internal function used by REPEAT_ONE extern playlist.c */ |
3754 | bool audio_pending_track_skip_is_auto(void) | 3762 | bool audio_pending_track_skip_is_manual(void) |
3755 | { | 3763 | { |
3756 | return (skip_pending == TRACK_SKIP_AUTO); | 3764 | logf("Track change is: %s", track_skip_is_manual ? "Manual": "Auto"); |
3765 | return track_skip_is_manual; | ||
3757 | } | 3766 | } |
3758 | 3767 | ||
3759 | /* Skip the specified number of tracks forward or backward from the current */ | 3768 | /* Skip the specified number of tracks forward or backward from the current */ |