Skip to content

Commit

Permalink
fix(DmPerformance): properly handle 0 in segment loop end
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed May 12, 2024
1 parent d192419 commit b4406a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Performance.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ static void DmPerformance_handleSegmentMessage(DmPerformance* slf, DmMessage_Seg
// NOTE: If we have a different `play_start` or `loop_start`, we need to discard messages
// before it and make sure to re-align them at time 0.
uint32_t start = msg->loop != 0 ? sgt->loop_start : sgt->play_start;
uint32_t end = msg->loop != 0 ? sgt->loop_end : sgt->length;
uint32_t end = (msg->loop != 0 && sgt->loop_end != 0) ? sgt->loop_end : sgt->length;

for (size_t i = 0; i < sgt->messages.length; ++i) {
DmMessage* m = &sgt->messages.data[i];
Expand Down

0 comments on commit b4406a5

Please sign in to comment.