Various fixes

This commit is contained in:
Ilya Laktyushin 2023-06-29 23:04:16 +02:00
parent 3b6c81e9b1
commit b7068142ec
3 changed files with 9 additions and 4 deletions

View File

@ -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)
}, action: { [weak self] _, f in
f(.dismissWithoutContent)

View File

@ -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)
}, action: { _, f in
f(.default)

View File

@ -518,7 +518,7 @@ public final class MediaEditorVideoExport {
let exportDuration = end - self.startTimestamp
print("video processing took \(exportDuration)s")
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 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
while writer.isReadyForMoreVideoData {
@ -542,6 +542,7 @@ public final class MediaEditorVideoExport {
return false
}
if writer.status != .writing {
Logger.shared.log("VideoExport", "Video finished")
writer.markVideoAsFinished()
return false
}
@ -552,9 +553,12 @@ public final class MediaEditorVideoExport {
composer.processImage(inputImage: image, pool: writer.pixelBufferPool, time: position, completion: { pixelBuffer, timestamp in
if let pixelBuffer {
if !writer.appendPixelBuffer(pixelBuffer, at: timestamp) {
Logger.shared.log("VideoExport", "Failed to append pixelbuffer")
writer.markVideoAsFinished()
appendFailed = true
}
} else {
Logger.shared.log("VideoExport", "No pixelbuffer from composer")
}
Thread.sleep(forTimeInterval: 0.001)
self.semaphore.signal()
@ -563,6 +567,7 @@ public final class MediaEditorVideoExport {
position = position + CMTime(value: 1, timescale: Int32(frameRate))
if position.seconds >= duration {
Logger.shared.log("VideoExport", "Video finished")
writer.markVideoAsFinished()
return false
}