Commit Graph
763 Commits
Author SHA1 Message Date
Scott GarrettandClaude Code e42855867d Fix SSA header parsing for files without a [V4+ Styles] section
Three latent bugs combined into a crash or silently-empty subtitle
import (surfaced by feeding conv.ass to the Matroska subtitle-add
path):

- parseHeader: used NSScanner scanUpToString: for the section
  markers; a failed scanUpToString: returns YES and advances the
  scan location to the end of the string, so a file lacking
  "[V4+ Styles]" left the scanner exhausted and the [Events]
  Format: line was never parsed. Locate the markers with
  rangeOfString: instead.
- The Format line is split on commas but names are separated with
  ", " in the wild; the leading spaces made every field name fail
  its isEqualToString: in MP42SSALine, so no line ever got
  text/timestamps. Split on comma and trim whitespace.
- MP42SSALine's value loop looped to `count - 1` on an NSUInteger;
  with an empty format array that underflows and appends forever
  until the array traps. Guard count == 0.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 11:53:01 -05:00
Scott GarrettandClaude Code 1040f47542 Add Matroska tagging and track-removal support
- MP42Ebml: EBML vint/ID primitives, flat Segment scanner, block track
  number decoding, and element builders shared by all Matroska writers.
- MP42MkvImporter / MP42FileImporter: tagsOnly mode that mirrors the
  file's own track flags instead of the MP4 conversion heuristics.
- MP42MatroskaTagMapping: read/write SimpleTag maps shared by importer
  and writer, including community names for MP4-only movie fields.
- MP42MkvTagWriter: mkvpropedit-style in-place rewrite of Tags, cover
  art, and per-track name/language/enabled/forced fields with a
  size+mtime staleness guard; an untouched save is a byte-for-byte
  no-op.
- MP42MkvRemuxer: stream-copy rebuild that drops the blocks of removed
  tracks (TrackNumbers keep their gaps; block bytes are never
  rewritten), regenerates SeekHead and Cues, carries metadata edits in
  the same pass, and writes via temp file + atomic rename.
- MP42MkvTagWriter+Internal.h exposes the tag writer's scanning and
  payload builders so the remuxer reuses them unchanged.

Verified with the external matrix harness: 241 assertions green across
layout fixtures (ffmpeg/mkvmerge/streamed), removal scenarios, cue
parity, and idempotency.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-25 19:48:09 -05:00
Damiano Galassi bfa477b799 Fix some undo issues 2026-10-03 11:46:29 +02:00
Damiano Galassi 37cd9b40b9 Add undo support to MP42Metadata 2026-10-03 10:26:27 +02:00
Damiano Galassi bb12164229 Additional work on undo support 2026-10-03 10:13:39 +02:00
Damiano Galassi f883d07809 Add newer ProRes format codes 2026-09-30 11:40:33 +02:00
Brett Pynn 0a3c902ce7 Updated saving mp4 where mismatched of language on tracks.
Specifically when either mdhd or elng is undefined and the other is set.
2026-09-30 11:14:23 +02:00
Damiano Galassi cf35350ad3 Additional undo/redo changes 2026-09-29 19:55:05 +02:00
Damiano Galassi 616cd9733b Update project 2026-09-29 16:19:03 +02:00
Damiano Galassi 993151da53 Initial work on using Apple's Vision framework to OCR subtitles 2026-09-29 11:35:08 +02:00
Damiano Galassi 0a8f6fe4ea Fix build on macOS 26 SDK 2026-09-22 20:33:17 +02:00
Damiano Galassi 2c6f987f5b Update localizations 2026-09-22 20:18:56 +02:00
Damiano Galassi 57236970a3 Add two methods two return the supported UTIs 2026-09-22 18:50:05 +02:00
Damiano Galassi 86dce73880 Fix warnings 2026-09-22 16:07:24 +02:00
Damiano Galassi 2b36c035de Add a metadata overwrite option 2026-09-11 09:51:30 +02:00
Damiano Galassi 740fd075b3 Improve MKV LanguageBCP47 conversion 2026-08-27 16:51:13 +02:00
Damiano Galassi 65acfeb7cd Clear the res string before using it
Fix some random timestamps being used as the subtitles text
when the subtitle has actually no text.
2026-08-19 16:32:44 +02:00
Damiano Galassi ab939411c3 Xcode project check 2026-08-19 10:19:28 +02:00
Damiano Galassi 9b34bb2ece Fix timescale conversion 2025-11-14 15:27:25 +01:00
Damiano Galassi 841a7d083e Some undo groundwork 2025-11-14 15:20:29 +01:00
Damiano Galassi c63253903d Another update check 2025-09-16 11:56:03 +02:00
Damiano Galassi 6b914137aa Run update check 2025-09-16 11:48:25 +02:00
Damiano Galassi de006c8704 Fix a constant name 2025-09-16 11:32:17 +02:00
Damiano Galassi 3b5e78211d Read Matroska LanguageBCP47 field 2025-09-15 14:24:56 +02:00
Damiano Galassi 72c09dab2d Xcode update check 2025-09-08 14:38:51 +02:00
Damiano Galassi 341f68b09d Read and write some unofficial metadata used for audiobooks 2025-08-12 16:14:11 +02:00
Damiano Galassi f104a7c69a Make a MP42Chapter method clearer 2025-07-25 17:35:42 +02:00
Damiano Galassi 47aadecfff Improve metadata conversion from MKV 2025-03-13 16:54:57 +01:00
Damiano Galassi f17dfb35d0 Fix typo 2025-03-11 11:57:17 +01:00
Damiano Galassi 84e5e5f898 Read and write the @dir tag 2025-03-11 11:56:30 +01:00
Damiano Galassi 8d0f691e3f Update submodule 2025-03-11 11:56:03 +01:00
Damiano Galassi 52b383e01b Fix a clang static analyzer warning 2025-03-10 10:18:40 +01:00
Damiano Galassi 531b5555b9 Xcode version check 2025-02-05 11:29:15 +01:00
Damiano Galassi c2c0d4a158 Read IPT_C2 matrix in AVFoundation demuxer 2024-11-30 10:42:27 +01:00
Damiano Galassi 8cad594f4d Xcode project version check 2024-11-29 15:59:20 +01:00
Damiano Galassi 818e568b89 Write color tag for Dolby Vision 2024-11-29 12:31:53 +01:00
Damiano Galassi b71f404a09 Fix a warning 2024-11-29 12:31:30 +01:00
Damiano Galassi ce670fe788 Check flac magic cookie length 2024-08-10 07:00:17 +02:00
Damiano Galassi b85f5d59e2 Fix flac magic cookie 2024-08-05 12:22:55 +02:00
arnnalddo aa541846bc Added Spanish (Latin America) translation 2024-07-18 12:06:08 +02:00
arnnalddo d5ddd8ff2e Added Spanish (Latin America) translation 2024-07-18 12:06:08 +02:00
Damiano Galassi a83c7e8e79 Move the image to data conversion to MP42Image 2024-07-18 11:26:52 +02:00
Damiano Galassi d2d3365d92 Update submodule 2024-07-18 10:32:30 +02:00
Damiano Galassi 6917c59bf1 Don't use deprecated methods 2024-07-06 17:03:11 +02:00
Damiano Galassi c6dc4a7ecb Update submodule 2024-07-06 10:38:22 +02:00
Damiano Galassi 21a575edad Update submodule 2024-07-04 09:25:18 +02:00
Damiano Galassi 29bbbd1380 Preserve additional metadata in the AVFoundation importer 2024-07-03 21:16:28 +02:00
Damiano Galassi a7abb72839 Connect the Compilation tag 2024-07-03 14:13:58 +02:00
Damiano Galassi a3c0f8e1ea Add a method to set the correct Chinese language if it's in the track name 2024-07-02 17:47:53 +02:00
Damiano Galassi cb5149390f Remove some old IKImageView methods 2024-06-30 12:46:56 +02:00