Closed cimbi closed 3 years ago
Is this still an issue? I can help debug if desired.
Figured this one out: when the first block decoded is in the second segment or later, the offset into the output buffer isn't being calculated correctly. The following code works correctly. Previously the start_sample of the segment wasn't being taken into account. The bug is that the start_sample of the block is defined to be zero for the first block of each segment (according to the MEF 3 spec, so the start_sample of the segment is relative to the channel, but the start_segment of the block is relative to the segment).
offset_into_output_buffer = (si4) (channel->segments[start_segment].metadata_fps->metadata.time_series_section_2->start_sample +
channel->segments[start_segment].time_series_indices_fps->time_series_indices[start_idx].start_sample) - start_samp;
commit 6f156395 fixes this issue?
No, that commit is a separate thing that doesn't really affect pymef, but just fixes incorrect code that could in the future be part of pymef. This issue is fixed by the same commit as the other issue. (sorry fo the confusion... I probably should have done separate commits for both issues, and then a third for the unrelated issue).
Fixed by e824bfe
Problem Description
When reading channel data by sample and the start sample is not in the first segment the code returns array of NaNs
Pymef version and platform
pymef=1.2.1 ubuntu 20.04