From f55cb77f899d3b2088abdca91c62cdfecddd4250 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 26 Sep 2024 01:34:56 -0400 Subject: [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 --- apps/playlist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) * Clean playlist at shutdown */ void playlist_shutdown(void) + { + /*BugFix we need to save resume info first */ + /*if (usb_detect() == USB_INSERTED)*/ + audio_stop(); struct playlist_info* playlist = ¤t_playlist; playlist_write_lock(playlist); - + logf("Closing Control %s", __func__); if (playlist->control_fd >= 0) pl_close_control(playlist); -- cgit v1.2.3