fix(tracks): sniff attachment MIME from file bytes and keep ffmpeg autobsf on repack

This commit is contained in:
imSp4rky
2026-12-02 15:24:00 -07:00
parent 4afc4f7a04
commit 3868928d98
7 changed files with 179 additions and 58 deletions
-18
View File
@@ -107,24 +107,6 @@ def test_a_repackage_failure_names_the_ffmpeg_reason(tmp_path: Path, monkeypatch
track.repackage()
@POSIX_STUBS
def test_a_malformed_aac_repackage_retries_with_the_adts_filter(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
script = (
'case "$*" in *aac_adtstoasc*) for last; do :; done; echo ok > "$last"; exit 0;; esac\n'
"echo 'Malformed AAC bitstream detected' >&2; exit 1"
)
monkeypatch.setattr(binaries, "FFMPEG", stub(tmp_path, "ffmpeg", script))
track = Audio("http://example.test/a.mp4", "en", codec=Audio.Codec.AAC)
track.path = tmp_path / "a.mp4"
track.path.write_bytes(b"audio")
track.repackage()
assert track.path == tmp_path / "a_repack.mp4" and track.path.read_text() == "ok\n"
@POSIX_STUBS
def test_a_subtitleedit_failure_names_the_reason_it_wrote_to_stdout(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch