diff --git a/Dreamio/VLCNativePlaybackBackend.swift b/Dreamio/VLCNativePlaybackBackend.swift index c246738..09b71f9 100644 --- a/Dreamio/VLCNativePlaybackBackend.swift +++ b/Dreamio/VLCNativePlaybackBackend.swift @@ -138,6 +138,9 @@ final class VLCNativePlaybackBackend: NSObject, NativePlaybackBackend { } mediaPlayer.position = Float(nextTime / duration) mediaPlayer.play() +#if DEBUG + schedulePostSeekDiagnostics(label: "jump", expectedTime: nextTime) +#endif #endif } @@ -368,6 +371,18 @@ final class VLCNativePlaybackBackend: NSObject, NativePlaybackBackend { } #if DEBUG + private func logPlaybackSnapshot(reason: String) { + print("[DreamioVLC] snapshot reason=\(reason) state=\(stateName(mediaPlayer.state)) isPlaying=\(mediaPlayer.isPlaying) isSeekable=\(mediaPlayer.isSeekable) time=\(currentTime) duration=\(duration) position=\(mediaPlayer.position) selectedAudio=\(mediaPlayer.currentAudioTrackIndex) selectedSubtitle=\(mediaPlayer.currentVideoSubTitleIndex)") + } + + private func schedulePostSeekDiagnostics(label: String, expectedTime: TimeInterval) { + [0.25, 1.0, 3.0, 6.0].forEach { delay in + DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in + self?.logPlaybackSnapshot(reason: "\(label)-after-\(String(format: "%.2f", delay))s expected=\(String(format: "%.3f", expectedTime))") + } + } + } + private func logAudioTracks(reason: String) { let names = mediaPlayer.audioTrackNames as? [String] ?? [] let indexes = mediaPlayer.audioTrackIndexes as? [NSNumber] ?? [] @@ -459,6 +474,7 @@ extension VLCNativePlaybackBackend: VLCMediaPlayerDelegate { func mediaPlayerStateChanged(_ aNotification: Notification) { #if DEBUG print("[DreamioVLC] state=\(stateName(mediaPlayer.state))") + logPlaybackSnapshot(reason: "state-\(stateName(mediaPlayer.state))") #endif switch mediaPlayer.state { case .buffering, .playing: diff --git a/docs/turns/2026-05-25-add-native-playback-seek-buffer.html b/docs/turns/2026-05-25-add-native-playback-seek-buffer.html index 3c21e53..82ecef3 100644 --- a/docs/turns/2026-05-25-add-native-playback-seek-buffer.html +++ b/docs/turns/2026-05-25-add-native-playback-seek-buffer.html @@ -349,6 +349,42 @@ index c3c2318..0fa779a 100644
Related Beads issue: dreamio-3yb. This update is still part of the same native playback seek-buffer branch.
After further testing still showed VLC repeatedly entering buffering after 15-second jumps, the DEBUG logging now captures a compact playback snapshot on every VLC state change and at 0.25, 1, 3, and 6 seconds after each fixed jump.
The caching and seek-mechanism changes have not resolved the stream-specific stall. The new logs are intended to show whether VLC's time and position continue advancing, whether playback remains marked as playing, and whether seekability changes while the user sees a stalled native player. That should make the next fix more grounded, likely either a recoverable re-open at the target timestamp or stream/range-support handling, instead of another blind VLC option change.
+ +diff --git a/Dreamio/VLCNativePlaybackBackend.swift b/Dreamio/VLCNativePlaybackBackend.swift
+@@
+ mediaPlayer.position = Float(nextTime / duration)
+ mediaPlayer.play()
++#if DEBUG
++ schedulePostSeekDiagnostics(label: "jump", expectedTime: nextTime)
++#endif
+@@
++ private func logPlaybackSnapshot(reason: String) {
++ print("[DreamioVLC] snapshot reason=\(reason) state=\(stateName(mediaPlayer.state)) isPlaying=\(mediaPlayer.isPlaying) isSeekable=\(mediaPlayer.isSeekable) time=\(currentTime) duration=\(duration) position=\(mediaPlayer.position) selectedAudio=\(mediaPlayer.currentAudioTrackIndex) selectedSubtitle=\(mediaPlayer.currentVideoSubTitleIndex)")
++ }
++
++ private func schedulePostSeekDiagnostics(label: String, expectedTime: TimeInterval) {
++ [0.25, 1.0, 3.0, 6.0].forEach { delay in
++ DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in
++ self?.logPlaybackSnapshot(reason: "\(label)-after-\(String(format: "%.2f", delay))s expected=\(String(format: "%.3f", expectedTime))")
++ }
++ }
++ }
+@@
+ print("[DreamioVLC] state=\(stateName(mediaPlayer.state))")
++ logPlaybackSnapshot(reason: "state-\(stateName(mediaPlayer.state))")
+
+ Related Beads issue: dreamio-3yb. This is a diagnostic update to the same native seek-buffer investigation. The diff is shown as a plain fallback because @pierre/diffs/ssr is not installed in this workspace.