A video whose container nothing identified has never been rendered #199

Closed
opened 2026-09-02 12:46:29 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-09-02 12:46:29 +00:00 (Migrated from github.com)

Wave 4, filed from a coverage read on main @ 54ca2dd, 2026-09-02. The shared filter note is on #194.

The file card's "Unknown" container is the ordinary case, and it has never been rendered

app/src/main/java/org/libremediaconverter/convert/ConverterScreen.kt:668
DetailRow("Container", probe.container?.label ?: "Unknown")

The null arm is missed. All of FileCardTest's video cases use a VIDEO_PROBE carrying container = Container.MP4.

Its twin is tested, which is the argument. FileCard renders that exact expression twice — once in the AUDIO_ONLY branch (:660) and once in the VIDEO branch (:668) — and FileCardTest's "an audio-only file nothing else could describe degrades one row at a time" already drives the audio one to "Unknown". Same line, same fallback, one kind covered and one not. That asymmetry is the same argument CLAUDE.md records for including ContainerCapabilities:94.

Why null is not an edge case here

InputProbe.container's own KDoc (model/OutputFormat.kt:183-186) says MediaExtractor cannot report a container at all — it comes from FFprobe. So on any device or run where FFprobe did not answer, a perfectly ordinary video file arrives with kind = VIDEO, real dimensions, a real codec, and container = null. That is not a corrupt input; it is the normal shape of a probe that only got half its sources.

Which makes the fallback a real user-facing string rather than defensive filler, and an empty value in its place would read as a rendering bug.

The work

One more case on FileCardTest's existing assertRow helper: a VIDEO-kind probe with container = null but otherwise complete — a real codec and real dimensions — asserting the container row reads Unknown while the video row still reads its codec and size. The second half is what keeps it from being a copy of the audio-only test: this is a file the app knows a lot about and cannot name the container of.

Acceptance: the mutation that must go red

?: "Unknown" → ?: "" at :668 only — the AUDIO_ONLY twin at :660 is a separate expression and mutating it would redden the existing test instead, which proves nothing about this one. Restore, confirm green.

Scope

Only the container row. The rest of :648's when (probe.kind) is covered — FileCardTest drives all four InputKind values, and the one missed branch there is the synthetic NoWhenBranchMatchedException default. Do not chase it.

_Wave 4, filed from a coverage read on `main` @ `54ca2dd`, 2026-09-02. The shared filter note is on #194._ ## The file card's "Unknown" container is the ordinary case, and it has never been rendered ``` app/src/main/java/org/libremediaconverter/convert/ConverterScreen.kt:668 ``` ```kotlin DetailRow("Container", probe.container?.label ?: "Unknown") ``` The null arm is missed. All of `FileCardTest`'s video cases use a `VIDEO_PROBE` carrying `container = Container.MP4`. **Its twin is tested, which is the argument.** `FileCard` renders that exact expression twice — once in the `AUDIO_ONLY` branch (`:660`) and once in the `VIDEO` branch (`:668`) — and `FileCardTest`'s *"an audio-only file nothing else could describe degrades one row at a time"* already drives the audio one to `"Unknown"`. Same line, same fallback, one kind covered and one not. That asymmetry is the same argument `CLAUDE.md` records for including `ContainerCapabilities:94`. ## Why null is not an edge case here `InputProbe.container`'s own KDoc (`model/OutputFormat.kt:183-186`) says `MediaExtractor` cannot report a container at all — it comes from FFprobe. So on any device or run where FFprobe did not answer, a perfectly ordinary video file arrives with `kind = VIDEO`, real dimensions, a real codec, and `container = null`. That is not a corrupt input; it is the normal shape of a probe that only got half its sources. Which makes the fallback a real user-facing string rather than defensive filler, and an empty value in its place would read as a rendering bug. ## The work One more case on `FileCardTest`'s existing `assertRow` helper: a VIDEO-kind probe with `container = null` but otherwise complete — a real codec and real dimensions — asserting the container row reads `Unknown` while the video row still reads its codec and size. The second half is what keeps it from being a copy of the audio-only test: this is a file the app knows a lot about and cannot name the container of. ## Acceptance: the mutation that must go red `?: "Unknown"` → `?: ""` **at `:668` only** — the `AUDIO_ONLY` twin at `:660` is a separate expression and mutating it would redden the existing test instead, which proves nothing about this one. Restore, confirm green. ## Scope Only the container row. The rest of `:648`'s `when (probe.kind)` is covered — `FileCardTest` drives all four `InputKind` values, and the one missed branch there is the synthetic `NoWhenBranchMatchedException` default. Do not chase it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMediaConverter#199