mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Various fixes
This commit is contained in:
parent
3b6c81e9b1
commit
b7068142ec
@ -2683,7 +2683,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
|||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
|
|
||||||
items.append(.action(ContextMenuActionItem(text: "Move to Contacts", icon: { theme in
|
items.append(.action(ContextMenuActionItem(text: "Hide \(peer.compactDisplayTitle)", icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/MoveToContacts"), color: theme.contextMenu.primaryColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/MoveToContacts"), color: theme.contextMenu.primaryColor)
|
||||||
}, action: { [weak self] _, f in
|
}, action: { [weak self] _, f in
|
||||||
f(.dismissWithoutContent)
|
f(.dismissWithoutContent)
|
||||||
|
|||||||
@ -85,7 +85,7 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con
|
|||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
|
|
||||||
items.append(.action(ContextMenuActionItem(text: "Move to chats", icon: { theme in
|
items.append(.action(ContextMenuActionItem(text: "Move to Chats", icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/MoveToChats"), color: theme.contextMenu.primaryColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/MoveToChats"), color: theme.contextMenu.primaryColor)
|
||||||
}, action: { _, f in
|
}, action: { _, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|||||||
@ -518,7 +518,7 @@ public final class MediaEditorVideoExport {
|
|||||||
let exportDuration = end - self.startTimestamp
|
let exportDuration = end - self.startTimestamp
|
||||||
print("video processing took \(exportDuration)s")
|
print("video processing took \(exportDuration)s")
|
||||||
if duration.seconds > 0 {
|
if duration.seconds > 0 {
|
||||||
print("\(exportDuration / duration.seconds) speed")
|
Logger.shared.log("VideoExport", "Video processing took \(exportDuration / duration.seconds)")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -534,7 +534,7 @@ public final class MediaEditorVideoExport {
|
|||||||
|
|
||||||
let duration: Double = 5.0
|
let duration: Double = 5.0
|
||||||
let frameRate: Double = Double(self.configuration.frameRate)
|
let frameRate: Double = Double(self.configuration.frameRate)
|
||||||
var position: CMTime = CMTime(value: 0, timescale: Int32(self.configuration.frameRate))
|
var position: CMTime = CMTime(value: 0, timescale: Int32(frameRate))
|
||||||
|
|
||||||
var appendFailed = false
|
var appendFailed = false
|
||||||
while writer.isReadyForMoreVideoData {
|
while writer.isReadyForMoreVideoData {
|
||||||
@ -542,6 +542,7 @@ public final class MediaEditorVideoExport {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if writer.status != .writing {
|
if writer.status != .writing {
|
||||||
|
Logger.shared.log("VideoExport", "Video finished")
|
||||||
writer.markVideoAsFinished()
|
writer.markVideoAsFinished()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -552,9 +553,12 @@ public final class MediaEditorVideoExport {
|
|||||||
composer.processImage(inputImage: image, pool: writer.pixelBufferPool, time: position, completion: { pixelBuffer, timestamp in
|
composer.processImage(inputImage: image, pool: writer.pixelBufferPool, time: position, completion: { pixelBuffer, timestamp in
|
||||||
if let pixelBuffer {
|
if let pixelBuffer {
|
||||||
if !writer.appendPixelBuffer(pixelBuffer, at: timestamp) {
|
if !writer.appendPixelBuffer(pixelBuffer, at: timestamp) {
|
||||||
|
Logger.shared.log("VideoExport", "Failed to append pixelbuffer")
|
||||||
writer.markVideoAsFinished()
|
writer.markVideoAsFinished()
|
||||||
appendFailed = true
|
appendFailed = true
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Logger.shared.log("VideoExport", "No pixelbuffer from composer")
|
||||||
}
|
}
|
||||||
Thread.sleep(forTimeInterval: 0.001)
|
Thread.sleep(forTimeInterval: 0.001)
|
||||||
self.semaphore.signal()
|
self.semaphore.signal()
|
||||||
@ -563,6 +567,7 @@ public final class MediaEditorVideoExport {
|
|||||||
|
|
||||||
position = position + CMTime(value: 1, timescale: Int32(frameRate))
|
position = position + CMTime(value: 1, timescale: Int32(frameRate))
|
||||||
if position.seconds >= duration {
|
if position.seconds >= duration {
|
||||||
|
Logger.shared.log("VideoExport", "Video finished")
|
||||||
writer.markVideoAsFinished()
|
writer.markVideoAsFinished()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user