Keep the bed positions in the Rosella path and across HRTF resets
ci / ubuntu-latest (push) Failing after 14s
ci / macos-latest (push) Canceled after 0s
ci / windows-latest (push) Canceled after 0s
ci / release (push) Canceled after 0s

This commit is contained in:
TheM14 committed 2026-10-30 05:23:04 +08:00
1 parent 075ef60afa
commit 8e688d496e
6 files changed
+36 -3

No files matched your search

+1 -1
View File
@@ -205,7 +205,7 @@ Status SofaBinauralRuntime::reset() {
if (ejoc_sofa_binaural_reset(handle_) != 0) {
return Status::fail(JOC_ERR_RENDER_FAILED, stage::kRender, "sofa reset failed");
}
timeline_ = timeline::OamdPositionTimeline();
timeline_.reset();
output_.clear();
staged_ = 0;
input_samples_ = 0;
+5 -1
View File
@@ -1329,7 +1329,7 @@ Status RosellaRuntime::reset() {
impl_->raw_output_samples = 0u;
impl_->metadata_block_updates = 0u;
impl_->finished = false;
impl_->timeline = timeline::OamdPositionTimeline(timeline::kTimelineObjects);
impl_->timeline.reset();
return Status::success();
}
@@ -1355,4 +1355,8 @@ std::uint64_t RosellaRuntime::metadata_block_updates() const {
}
const timeline::OamdPositionTimeline& RosellaRuntime::timeline() const { return impl_->timeline; }
void RosellaRuntime::set_fixed_position(int object_index, const double position[3]) {
impl_->timeline.set_fixed_position(object_index, position);
}
} // namespace joc::hrtf
+3
View File
@@ -56,6 +56,9 @@ public:
std::uint64_t metadata_block_updates() const;
const timeline::OamdPositionTimeline& timeline() const;
// bed 声道是固定通道:OAMD 不给位置,方位由声明的 bed 布局给出。
void set_fixed_position(int object_index, const double position[3]);
private:
struct Impl;
std::unique_ptr<Impl> impl_;
+6 -1
View File
@@ -206,9 +206,14 @@ void Stream::apply_bed_positions(const FrameMetadata& entry) {
++slot) {
const ::joc::joc::BedChannel channel = bed.channels[slot];
double xyz[3] = {0.0, 0.0, 0.0};
if (binaural_ready_ && ::joc::joc::bed_channel_adm_position(channel, xyz)) {
if (::joc::joc::bed_channel_adm_position(channel, xyz)) {
if (binaural_ready_) {
binaural_.set_fixed_position(static_cast<int>(slot) + 1, xyz);
}
if (rosella_ready_) {
rosella_.set_fixed_position(static_cast<int>(slot) + 1, xyz);
}
}
if (!speaker_enabled_) {
continue;
}
+4
View File
@@ -1780,6 +1780,10 @@ Status run(const joc_task_config& raw, const joc_event_sink* sink, joc_task_resu
binaural.set_fixed_position(
static_cast<int>(slot) + 1, xyz);
}
if (rosella_enabled) {
rosella.set_fixed_position(
static_cast<int>(slot) + 1, xyz);
}
}
if (!speaker_enabled) {
continue;
+17
View File
@@ -60,6 +60,23 @@ public:
fixed_xyz_[object_index - 1][2] = position[2];
}
// Drops the OAMD state and every transition but keeps the fixed bed positions:
// they describe the content, not the playback position.
void reset() {
state_.reset();
for (int index = 0; index < kTimelineObjects; ++index) {
tracks_[index] = ObjectPositionTrack();
has_previous_[index] = false;
for (int axis = 0; axis < 3; ++axis) {
previous_targets_[index][axis] = 0.0;
}
}
initialized_ = false;
payload_count_ = 0;
transition_count_ = 0;
last_coded_event_sample_ = -1;
}
std::uint64_t payload_count() const { return payload_count_; }
std::uint64_t transition_count() const { return transition_count_; }
bool initialized() const { return initialized_; }