| @@ -36,6 +36,7 @@ type streamSession struct { | |||||
| lastFeed time.Time | lastFeed time.Time | ||||
| playbackMode string | playbackMode string | ||||
| stereoState string | stereoState string | ||||
| lastAudioTs time.Time | |||||
| // listenOnly sessions have no WAV file and no disk I/O. | // listenOnly sessions have no WAV file and no disk I/O. | ||||
| // They exist solely to feed audio to live-listen subscribers. | // They exist solely to feed audio to live-listen subscribers. | ||||
| @@ -389,6 +390,16 @@ func (st *Streamer) processFeed(msg streamFeedMsg) { | |||||
| sess.wavSamples += int64(n / 2) | sess.wavSamples += int64(n / 2) | ||||
| } | } | ||||
| } | } | ||||
| // Gap logging for live-audio sessions | |||||
| if len(sess.audioSubs) > 0 { | |||||
| if !sess.lastAudioTs.IsZero() { | |||||
| gap := time.Since(sess.lastAudioTs) | |||||
| if gap > 150*time.Millisecond { | |||||
| logging.Warn("gap", "audio_gap", "signal", sess.signalID, "gap_ms", gap.Milliseconds()) | |||||
| } | |||||
| } | |||||
| sess.lastAudioTs = time.Now() | |||||
| } | |||||
| st.fanoutPCM(sess, pcm, pcmLen) | st.fanoutPCM(sess, pcm, pcmLen) | ||||
| } | } | ||||