Skip to content

Commit

Permalink
Remove unused timestampScale code
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Nov 19, 2024
1 parent a7178f8 commit 7fb5a8a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion Sources/macSubtitleOCR/MKV/EBML/EBML.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ enum EBML {
static let segmentID: UInt32 = 0x1853_8067
static let simpleBlock: UInt32 = 0xA3
static let timestamp: UInt32 = 0xE7
static let timestampScale: UInt32 = 0x2AD7B1
static let tracksID: UInt32 = 0x1654_AE6B
static let trackEntryID: UInt32 = 0xAE
static let trackTypeID: UInt32 = 0x83
Expand Down
9 changes: 0 additions & 9 deletions Sources/macSubtitleOCR/MKV/MKVFileHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class MKVFileHandler {

let fileHandle: FileHandle
let endOfFile: UInt64
var timestampScale: TimeInterval = 1000000.0 // Default value if not specified in a given MKV file
let logger = Logger(subsystem: "com.ecdye.macSubtitleOCR", category: "MKV")
let ebmlParser: EBMLParser

Expand Down Expand Up @@ -61,14 +60,6 @@ class MKVFileHandler {
// Ensure we stop if we have reached or passed the EOF
guard fileHandle.offsetInFile < endOfFile else { return (nil, nil) }

// If, by chance, we find a TimestampScale element, update it from the default
if elementID == EBML.timestampScale {
timestampScale = Double(readFixedLengthNumber(fileHandle: fileHandle, length: Int(elementSize)))
// swiftformat:disable:next redundantSelf
logger.debug("Found timestamp scale: \(self.timestampScale)")
continue
}

// If a Cluster header is encountered, seek back to the start of the Cluster
if elementID == EBML.cluster && avoidCluster {
logger.debug("Encountered Cluster: seeking back to before the cluster header")
Expand Down

0 comments on commit 7fb5a8a

Please sign in to comment.