Skip to content

Commit c30746d

Browse files
committed
refactor(windows): simplify frame delay calculation and podspec path separator
1 parent e519e09 commit c30746d

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

mediaplayer/ComposeMediaPlayer.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ Pod::Spec.new do |spec|
4141
SCRIPT
4242
}
4343
]
44-
spec.resources = ['build/compose/cocoapods/compose-resources']
44+
spec.resources = ['build\compose\cocoapods\compose-resources']
4545
end

mediaplayer/src/jvmMain/kotlin/io/github/kdroidfilter/composemediaplayer/windows/WindowsVideoPlayerState.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,9 @@ class WindowsVideoPlayerState : VideoPlayerState {
822822
// Send frame to channel
823823
frameChannel.trySend(FrameData(targetBitmap, frameTime))
824824

825-
// Yield to the audio thread on the shared SourceReader.
826-
// Native AcquireNextSample already sleeps to pace video to
827-
// the presentation clock, so this delay just prevents tight
828-
// looping when frames are skipped or the decoder is fast.
829-
delay(frameIntervalMs)
825+
// Native AcquireNextSample already paces video to the audio
826+
// clock via PreciseSleepHighRes — no additional delay needed.
827+
delay(1)
830828
} catch (e: CancellationException) {
831829
break
832830
} catch (e: Exception) {
@@ -882,7 +880,7 @@ class WindowsVideoPlayerState : VideoPlayerState {
882880
}
883881
isLoading = false
884882

885-
delay(frameIntervalMs)
883+
delay(1)
886884
} catch (e: CancellationException) {
887885
break
888886
} catch (e: Exception) {

0 commit comments

Comments
 (0)