Trace stream audio startup demand and link Windows COM cleanup

This commit is contained in:
evgeny committed 2026-10-16 16:58:01 +02:00
1 parent 014a110fd5
commit c37be1c3e8
3 files changed
+27 -1

No files matched your search

@@ -52,6 +52,8 @@ class StreamPlayerEngine(private val group: Long, private val source: Long, priv
var position = -1L
var ready = -1L
var needsAudio = true
var audioInputs = 0L
var lastAudioPts = -1L
var generation = 0L
var playbackStarted = false
var eosQueued = false
@@ -178,6 +180,7 @@ class StreamPlayerEngine(private val group: Long, private val source: Long, priv
}
}
2 -> if (audioEnabled && playback != 0L) {
audioInputs++; lastAudioPts = pts
val result = NativeLib.streamPlaybackFeed(playback, pts, ByteArray(size).also { b.get(it) })
if (result == -2) resetTimeline(true) else check(result >= 0) { "Opus feed failed=$result" }
}
@@ -235,7 +238,8 @@ class StreamPlayerEngine(private val group: Long, private val source: Long, priv
LogManager.addLog("DEBUG", "stream", "viewer id=$id revision=$videoRevision inputs=${video.inputCount} " +
"decoded=${video.outputCount} shown=${video.shown} discarded=${video.discarded} input=${video.input != null} " +
"output=${video.output?.pts} inflight=${video.inflight} decoderLeadUs=${video.decoderLeadUs} " +
"clock=$position reserve=${clockState?.get(1)} minimum=${clockState?.get(2)} " +
"clock=$position ready=$ready audio=$audioEnabled audioInputs=$audioInputs audioPTS=$lastAudioPts needsAudio=$needsAudio " +
"reserve=${clockState?.get(1)} minimum=${clockState?.get(2)} " +
"tempo=${clockState?.get(3)} ${audio.description} waitingKey=$waitingKey")
}
Thread.sleep(5)