From cc1df6616593930e45cc89249cfb8a1b602fdbdb Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Fri, 11 Oct 2024 20:52:26 +0400 Subject: [PATCH] Fix !soft --- submodules/MediaPlayer/Sources/MediaPlayerNode.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/submodules/MediaPlayer/Sources/MediaPlayerNode.swift b/submodules/MediaPlayer/Sources/MediaPlayerNode.swift index c58bb8d5f0..cf4a6e6dd2 100644 --- a/submodules/MediaPlayer/Sources/MediaPlayerNode.swift +++ b/submodules/MediaPlayer/Sources/MediaPlayerNode.swift @@ -195,11 +195,9 @@ public final class MediaPlayerNode: ASDisplayNode { state.maxTakenTime = frameTime let attachments = CMSampleBufferGetSampleAttachmentsArray(frame.sampleBuffer, createIfNecessary: true)! as NSArray let dict = attachments[0] as! NSMutableDictionary - if i == 0 { + if i == 0 && !soft { CMSetAttachment(frame.sampleBuffer, key: kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding as NSString, value: kCFBooleanTrue as AnyObject, attachmentMode: kCMAttachmentMode_ShouldPropagate) - if !soft { - CMSetAttachment(frame.sampleBuffer, key: kCMSampleBufferAttachmentKey_EndsPreviousSampleDuration as NSString, value: kCFBooleanTrue as AnyObject, attachmentMode: kCMAttachmentMode_ShouldPropagate) - } + CMSetAttachment(frame.sampleBuffer, key: kCMSampleBufferAttachmentKey_EndsPreviousSampleDuration as NSString, value: kCFBooleanTrue as AnyObject, attachmentMode: kCMAttachmentMode_ShouldPropagate) } if !soft { if CMTimeCompare(frame.position, atTime) < 0 {