Skip to content

Commit

Permalink
fixed an issue where the screen might not render.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Jan 2, 2025
1 parent b3ceb9e commit 23eb0dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions HaishinKit/Sources/Mixer/MediaMixer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public final actor MediaMixer {
}
}

func setVideoRenderingMode(_ mode: VideoMixerSettings.Mode) {
private func setVideoRenderingMode(_ mode: VideoMixerSettings.Mode) {
guard isRunning else {
return
}
Expand All @@ -371,7 +371,7 @@ public final actor MediaMixer {
}

#if os(iOS) || os(tvOS) || os(visionOS)
func setBackgroundMode(_ background: Bool) {
private func setBackgroundMode(_ background: Bool) {
guard #available(tvOS 17.0, *) else {
return
}
Expand All @@ -397,7 +397,7 @@ extension MediaMixer: AsyncRunner {
Task { @ScreenActor in
var sampleBuffer = inputs.1
screen.append(inputs.0, buffer: sampleBuffer)
if await videoMixerSettings.mainTrack == inputs.0 {
if await videoMixerSettings.mainTrack == inputs.0 && 0 < screen.targetTimestamp {
let diff = ceil((screen.targetTimestamp - sampleBuffer.presentationTimeStamp.seconds) * 10000) / 10000
screen.videoCaptureLatency = diff
}
Expand Down

0 comments on commit 23eb0dd

Please sign in to comment.