Carry a truncated JOC payload as an invalid frame status
ci / ubuntu-latest (push) Failing after 13s
ci / macos-latest (push) Canceled after 0s
ci / windows-latest (push) Canceled after 0s
ci / release (push) Canceled after 0s

A real E-AC-3 JOC stream can carry an ID14 payload that ends inside joc_data:
the header, clipgain, sequence counter and object parameters are complete,
only the per-object matrices are missing.  That frame used to abort the
stream with JOC_ERR_BITSTREAM_TRUNCATED.

The overrun is now classified as JOC_FRAME_STATUS_TRUNCATED (7) and the
renderer takes its existing invalid-frame path, so it holds the previous
matrices and playback continues; the damaged frame stays visible in the
stream's truncated_joc_frames counter and the file task's warning.  A payload
too short for the 12-bit joc_header, a container length past the syncframe
and a Huffman walk leaving the tree stay fatal, the strict padding checker
still reports the truncation, and container scoring no longer prefers such a
payload.

The stream status struct grows by one appended field and joc_stream_status()
accepts the previous size as well.  Bump the version to 1.3.0.
This commit is contained in:
TheM14 committed 2026-11-09 23:53:16 +08:00
1 parent 3f0d5e87fe
commit abce8465f8
12 files changed
+309 -37

No files matched your search

+6 -2
View File
@@ -97,8 +97,9 @@ typedef struct joc_stream_status_info {
uint64_t oamd_payloads;
uint64_t oamd_transitions;
/* Metadata the renderer had to work around, per audio frame: no JOC payload at
* all, a declared object count clamped to 15, and a syncframe carrying a second
* EMDF container that is not this frame's JOC metadata. */
* all, an ID14 payload that ends inside joc_data (that frame holds the previous
* matrices), a declared object count clamped to 15, and a syncframe carrying a
* second EMDF container that is not this frame's JOC metadata. */
uint64_t missing_joc_frames;
uint64_t objects_clamped_frames;
uint64_t extra_container_frames;
@@ -108,6 +109,9 @@ typedef struct joc_stream_status_info {
uint64_t bed_mask_mismatch_frames;
uint32_t output_channels;
uint32_t ended; /* 1 after flush() */
/* Appended field: joc_stream_status() accepts the size that ends at `ended`
* as well, so a caller built against the previous header keeps working. */
uint64_t truncated_joc_frames;
} joc_stream_status_info;
JOC_API joc_error JOC_CALL joc_stream_create(const joc_stream_config* config, joc_stream** out);