Sync the 1.3.1 kernel and read the stream until its first JOC frame
build / windows (push) Canceled after 0s
build / release (push) Canceled after 0s

The kernel copy follows JustOneCacophonyCXX 1.3.1: a frame without JOC metadata
mid-stream now holds the previous matrices instead of switching to the core
planes, which removes the clicks the 6.0 kernels produced on encoders that drop
the JOC metadata for single frames.

resolve_bed_channels() called ReadFile once and scanned that single chunk.  A
read returns only the bytes that are available (a pipe hands over a partial
chunk), and an encoder may leave the first audio frames without JOC metadata,
so the first JOC frame could sit past the window.  The scan then fell back to 6
bed channels, and the first JOC frame (joc_dmx_config_idx=1, 8 channels) was
rejected with core_channel_count_mismatch.  The scan now reads 64 KiB chunks
until the first syncframe carrying the JOC EMDF container is seen, keeps the
trailing partial frame between reads, and rewinds the stream as before; the
container path and the bare-file path both use it.

Bump the component version to 0.6.1, and pin the kernel notices to 1.3.1.

Verified with the offline harness: the reported GNR M4A now reports
"joc_dmx_config_idx=1 -> 8 bed channel(s)" and decodes the whole track (8906
frames), and the Smooth Criminal opening no longer steps at the two frames
without metadata (6.016 s and 7.328 s).
This commit is contained in:
TheM14 committed 2026-11-10 15:35:32 +08:00
1 parent 886ff036cd
commit 5c0f9ea2ff
9 files changed
+87 -19

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@
#define JOC_VERSION_MAJOR 1
#define JOC_VERSION_MINOR 3
#define JOC_VERSION_PATCH 0
#define JOC_VERSION_STRING "1.3.0"
#define JOC_VERSION_PATCH 1
#define JOC_VERSION_STRING "1.3.1"
#endif /* JOC_VERSION_H */
+1 -1
View File
@@ -5,7 +5,7 @@
shipping and loading joc_core.dll.
The sources under kernel\src and kernel\include are a verbatim copy of the
upstream library at commit abce8465f8edda3356738e1a1db7cb1b33191c72 (see
upstream library at version 1.3.1 (see
JustOneCacophonyCXX\CMakeLists.txt): nothing under either
tree is edited here, and both are kept identical to it, so a single core serves
the upstream tools and this component alike. The static build needs no branch
+27 -1
View File
@@ -800,9 +800,35 @@ private:
return pre_state;
}
// Compatibility note for frames without JOC metadata (status 8).
//
// The state machine used to map status 8 to Passthrough unconditionally,
// including in the middle of a stream. That is only meaningful before the
// first valid JOC frame: a plain E-AC-3 stream (or a stream whose first JOC
// frame comes late) has no object state yet, so the core planes are all
// there is and the delayed core PCM is the right output. In the middle of
// a JOC stream a frame without metadata is a damaged frame, not "no
// objects": the Passthrough output replaces the object render with the core
// planes, and the object synthesis restarts from silence on the next frame.
// Every such frame therefore produced a step at the frame boundary and a
// second one when the metadata came back; encoders that are not careful
// with the JOC EMDF container emit exactly those frames.
//
// After the change status 8 follows the state machine like the other
// invalid statuses: state 0 (no valid frame rendered yet) stays Passthrough,
// and state 3 (mid-stream) selects Hold, which reuses the previous object
// matrices and keeps the bed and object rendering continuous.
//
// This is a compatibility choice, not a claim about the normative reading
// of the specification: a frame without metadata can be argued to be the
// Passthrough case. It exists so that non-standard streams stay click-free;
// if the reference behaviour is preferred, re-add the unconditional
// Passthrough branch here.
FrameMode select_mode(const uint32_t status) const noexcept {
if (status == EJOC_FRAME_STATUS_NO_METADATA) {
return FrameMode::Passthrough;
// See the note above: only a stream that has not rendered a valid
// frame yet has nothing to hold.
return state_ == 0u ? FrameMode::Passthrough : FrameMode::Hold;
}
if (state_ == 4u) {
return FrameMode::HardCut;