@@ -83,6 +83,7 @@ public final class FFMpegMediaFrameSource: NSObject, MediaFrameSource {
8383 private let fetchAutomatically : Bool
8484 private let maximumFetchSize : Int ?
8585 private let storeAfterDownload : ( ( ) -> Void ) ?
86+ private let isAudioVideoMessage : Bool
8687
8788 private let taskQueue : ThreadTaskQueue
8889 private let thread : Thread
@@ -103,7 +104,7 @@ public final class FFMpegMediaFrameSource: NSObject, MediaFrameSource {
103104 }
104105 }
105106
106- public init ( queue: Queue , postbox: Postbox , userLocation: MediaResourceUserLocation , userContentType: MediaResourceUserContentType , resourceReference: MediaResourceReference , tempFilePath: String ? , limitedFileRange: Range < Int64 > ? , streamable: Bool , isSeekable: Bool , video: Bool , preferSoftwareDecoding: Bool , fetchAutomatically: Bool , maximumFetchSize: Int ? = nil , stallDuration: Double = 1.0 , lowWaterDuration: Double = 2.0 , highWaterDuration: Double = 3.0 , storeAfterDownload: ( ( ) -> Void ) ? = nil ) {
107+ public init ( queue: Queue , postbox: Postbox , userLocation: MediaResourceUserLocation , userContentType: MediaResourceUserContentType , resourceReference: MediaResourceReference , tempFilePath: String ? , limitedFileRange: Range < Int64 > ? , streamable: Bool , isSeekable: Bool , video: Bool , preferSoftwareDecoding: Bool , fetchAutomatically: Bool , maximumFetchSize: Int ? = nil , stallDuration: Double = 1.0 , lowWaterDuration: Double = 2.0 , highWaterDuration: Double = 3.0 , storeAfterDownload: ( ( ) -> Void ) ? = nil , isAudioVideoMessage : Bool = false ) {
107108 self . queue = queue
108109 self . postbox = postbox
109110 self . userLocation = userLocation
@@ -121,6 +122,7 @@ public final class FFMpegMediaFrameSource: NSObject, MediaFrameSource {
121122 self . lowWaterDuration = lowWaterDuration
122123 self . highWaterDuration = highWaterDuration
123124 self . storeAfterDownload = storeAfterDownload
125+ self . isAudioVideoMessage = isAudioVideoMessage
124126
125127 self . taskQueue = ThreadTaskQueue ( )
126128
@@ -199,9 +201,10 @@ public final class FFMpegMediaFrameSource: NSObject, MediaFrameSource {
199201 let fetchAutomatically = self . fetchAutomatically
200202 let maximumFetchSize = self . maximumFetchSize
201203 let storeAfterDownload = self . storeAfterDownload
204+ let isAudioVideoMessage = self . isAudioVideoMessage
202205
203206 self . performWithContext { [ weak self] context in
204- context. initializeState ( postbox: postbox, userLocation: userLocation, resourceReference: resourceReference, tempFilePath: tempFilePath, limitedFileRange: limitedFileRange, streamable: streamable, isSeekable: isSeekable, video: video, preferSoftwareDecoding: preferSoftwareDecoding, fetchAutomatically: fetchAutomatically, maximumFetchSize: maximumFetchSize, storeAfterDownload: storeAfterDownload)
207+ context. initializeState ( postbox: postbox, userLocation: userLocation, resourceReference: resourceReference, tempFilePath: tempFilePath, limitedFileRange: limitedFileRange, streamable: streamable, isSeekable: isSeekable, video: video, preferSoftwareDecoding: preferSoftwareDecoding, fetchAutomatically: fetchAutomatically, maximumFetchSize: maximumFetchSize, storeAfterDownload: storeAfterDownload, isAudioVideoMessage : isAudioVideoMessage )
205208
206209 let ( frames, endOfStream) = context. takeFrames ( until: timestamp, types: types)
207210
@@ -253,6 +256,7 @@ public final class FFMpegMediaFrameSource: NSObject, MediaFrameSource {
253256 let fetchAutomatically = self . fetchAutomatically
254257 let maximumFetchSize = self . maximumFetchSize
255258 let storeAfterDownload = self . storeAfterDownload
259+ let isAudioVideoMessage = self . isAudioVideoMessage
256260
257261 let currentSemaphore = Atomic < Atomic < DispatchSemaphore ? > ? > ( value: nil )
258262
@@ -263,7 +267,7 @@ public final class FFMpegMediaFrameSource: NSObject, MediaFrameSource {
263267 self . performWithContext { [ weak self] context in
264268 let _ = currentSemaphore. swap ( context. currentSemaphore)
265269
266- context. initializeState ( postbox: postbox, userLocation: userLocation, resourceReference: resourceReference, tempFilePath: tempFilePath, limitedFileRange: limitedFileRange, streamable: streamable, isSeekable: isSeekable, video: video, preferSoftwareDecoding: preferSoftwareDecoding, fetchAutomatically: fetchAutomatically, maximumFetchSize: maximumFetchSize, storeAfterDownload: storeAfterDownload)
270+ context. initializeState ( postbox: postbox, userLocation: userLocation, resourceReference: resourceReference, tempFilePath: tempFilePath, limitedFileRange: limitedFileRange, streamable: streamable, isSeekable: isSeekable, video: video, preferSoftwareDecoding: preferSoftwareDecoding, fetchAutomatically: fetchAutomatically, maximumFetchSize: maximumFetchSize, storeAfterDownload: storeAfterDownload, isAudioVideoMessage : isAudioVideoMessage )
267271
268272 context. seek ( timestamp: timestamp, completed: { streamDescriptionsAndTimestamp in
269273 queue. async {
0 commit comments