From 529c871b0e672d4fe4da48260d3f96ca927de74f Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Sat, 1 Aug 2026 08:36:01 +0800 Subject: [PATCH] fix(station): allow music to restart after stop Keep the active music stream attached until Audio.stop runs so stop requests finish the stream reader cleanly and the next music playback can start again without getting stuck behind the previous stream. --- station_broadcast.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/station_broadcast.lua b/station_broadcast.lua index a463e95..123579d 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -2,7 +2,7 @@ -- ============================================================================ -- 1. Configuration & Constants -- ============================================================================ -local APP_VERSION_TEXT = "v1.0.9" +local APP_VERSION_TEXT = "v1.0.10" local CONFIG = { CLOUD_URL = "ws://stabadmin.fse-media.group", @@ -1628,11 +1628,9 @@ function Network.messageLoop() end State.audioQueue = kept - if State.audioRx and tostring(State.audioRx.source or "") == "music" then - State.audioRx = nil - end - - if State.currentPlaying and tostring(State.currentPlaying.source or "") == "music" then + local hasMusicRx = State.audioRx and tostring(State.audioRx.source or "") == "music" + local hasMusicCurrent = State.currentPlaying and tostring(State.currentPlaying.source or "") == "music" + if hasMusicRx or hasMusicCurrent then Audio.stop("current") end else