Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 6, 2021
1 parent 45bf373 commit 4aea424
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gifski.xcodeproj/project.pbxproj
Expand Up @@ -811,7 +811,7 @@
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 7.4.0;
minimumVersion = 7.5.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
4 changes: 2 additions & 2 deletions Gifski/EditVideoViewController.swift
Expand Up @@ -484,8 +484,8 @@ final class EditVideoViewController: NSViewController {

private func cancelFileSizeEstimation() {
// TODO: Deinit doesn't seem to be called.
self.gifski?.cancel()
self.gifski = nil
gifski?.cancel()
gifski = nil

if estimatedSizeLabel.stringValue.contains("Calculating") {
setEstimatedFileSize(getNaiveEstimate().attributedString)
Expand Down
10 changes: 5 additions & 5 deletions Gifski/Utilities.swift
Expand Up @@ -613,7 +613,7 @@ extension AVAssetTrack {
// swiftlint:disable:next force_cast
let formatDescription = rawDescription as! CMFormatDescription

return CMFormatDescriptionGetMediaSubType(formatDescription).toString()
return CMFormatDescriptionGetMediaSubType(formatDescription).fourCharCodeToString()
}

var codec: AVFormat? {
Expand All @@ -637,10 +637,10 @@ extension AVAssetTrack {
var format = [String]()
for description in descriptions {
// Get string representation of media type (vide, soun, sbtl, etc.)
let type = CMFormatDescriptionGetMediaType(description).toString()
let type = CMFormatDescriptionGetMediaType(description).fourCharCodeToString()

// Get string representation media subtype (avc1, aac, tx3g, etc.)
let subType = CMFormatDescriptionGetMediaSubType(description).toString()
let subType = CMFormatDescriptionGetMediaSubType(description).fourCharCodeToString()

format.append("\(type)/\(subType)")
}
Expand Down Expand Up @@ -687,7 +687,7 @@ extension AVAssetTrack {
*/
extension FourCharCode {
/// Create a String representation of a FourCC.
func toString() -> String {
func fourCharCodeToString() -> String {
let a_ = self >> 24
let b_ = self >> 16
let c_ = self >> 8
Expand Down Expand Up @@ -795,7 +795,7 @@ enum AVFormat: String {
}

init?(fourCC: FourCharCode) {
self.init(fourCC: fourCC.toString())
self.init(fourCC: fourCC.fourCharCodeToString())
}

var fourCC: String {
Expand Down

0 comments on commit 4aea424

Please sign in to comment.