Skip to content

Commit

Permalink
Reduce unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Oct 17, 2024
1 parent 1e621f4 commit e9129a6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ let package = Package(
.testTarget(
name: "macSubtitleOCRTests",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.target(name: "macSubtitleOCR")
],
resources: [
Expand Down
3 changes: 1 addition & 2 deletions Sources/macSubtitleOCR/Subtitles/FFmpeg/FFmpeg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ struct FFmpeg {
// Extract image data (bitmap)
subtitle.imageWidth = Int(rect.pointee.w)
subtitle.imageHeight = Int(rect.pointee.h)
subtitle.imageXOffset = Int(rect.pointee.linesize.0)
logger.debug("Image size: \(subtitle.imageWidth!)x\(subtitle.imageHeight!)")

let imageSize = (subtitle.imageXOffset ?? 0) * (subtitle.imageHeight ?? 0)
let imageSize = Int(rect.pointee.linesize.0) * (subtitle.imageHeight ?? 0)
if let bitmapData = rect.pointee.data.0 {
let buffer = UnsafeBufferPointer(start: bitmapData, count: imageSize)
subtitle.imageData = Data(buffer)
Expand Down

0 comments on commit e9129a6

Please sign in to comment.