diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-09-26 01:34:56 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2024-09-26 01:34:56 -0400 |
commit | f55cb77f899d3b2088abdca91c62cdfecddd4250 (patch) | |
tree | 8956900c70985a7020ab177eccf7e0977fe23eb4 | |
parent | e6313e4b8ebd6314fe45c52c35ee8a12e409219b (diff) | |
download | rockbox-f55cb77f899d3b2088abdca91c62cdfecddd4250.tar.gz rockbox-f55cb77f899d3b2088abdca91c62cdfecddd4250.zip |
[Bugfix] FS#13492 - Playback resume fails after USB insert
On usb plug system_flush() gets called before the other
threads get a chance to ACK the insert
system_flush() calls playlist_shutdown() (amongst other things)
playlist_shutdown closes the control file
the audio thread acks USB insert
audio_stop_playback is called which now can't look up the
filename from the now closed handle for control the control file
I left the guard for checking for USB insert but it appears to be
fine without it
Change-Id: I935dbf7aed38d4a57413c0063ad953f427e9b3bb
-rw-r--r-- | apps/playlist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index d23f3ec0d1..af5e1b5df0 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -1949,10 +1949,14 @@ void playlist_init(void) | |||
1949 | * Clean playlist at shutdown | 1949 | * Clean playlist at shutdown |
1950 | */ | 1950 | */ |
1951 | void playlist_shutdown(void) | 1951 | void playlist_shutdown(void) |
1952 | |||
1952 | { | 1953 | { |
1954 | /*BugFix we need to save resume info first */ | ||
1955 | /*if (usb_detect() == USB_INSERTED)*/ | ||
1956 | audio_stop(); | ||
1953 | struct playlist_info* playlist = ¤t_playlist; | 1957 | struct playlist_info* playlist = ¤t_playlist; |
1954 | playlist_write_lock(playlist); | 1958 | playlist_write_lock(playlist); |
1955 | 1959 | logf("Closing Control %s", __func__); | |
1956 | if (playlist->control_fd >= 0) | 1960 | if (playlist->control_fd >= 0) |
1957 | pl_close_control(playlist); | 1961 | pl_close_control(playlist); |
1958 | 1962 | ||