Skip to content

Commit bb48354

Browse files
committed
Reverse get_relevant_time() logic
Unknown actions (including FETCH_AND_RESET_STATS) will get "currentTime".
1 parent 3af889e commit bb48354

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/rtmixer.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,23 @@ PaTime get_relevant_time(const struct action* action
8484
, const PaStreamCallbackTimeInfo* timeInfo)
8585
{
8686
enum actiontype type = action->type;
87-
if (type == FETCH_AND_RESET_STATS)
88-
{
89-
return timeInfo->currentTime;
90-
}
9187
if (type == CANCEL)
9288
{
9389
CALLBACK_ASSERT(action->action);
9490
type = action->action->type;
9591
}
96-
if (type == PLAY_BUFFER || type == PLAY_RINGBUFFER)
92+
93+
switch (type)
9794
{
98-
return timeInfo->outputBufferDacTime;
95+
case PLAY_BUFFER:
96+
case PLAY_RINGBUFFER:
97+
return timeInfo->outputBufferDacTime;
98+
case RECORD_BUFFER:
99+
case RECORD_RINGBUFFER:
100+
return timeInfo->inputBufferAdcTime;
101+
default:
102+
return timeInfo->currentTime;
99103
}
100-
CALLBACK_ASSERT(type == RECORD_BUFFER || type == RECORD_RINGBUFFER);
101-
return timeInfo->inputBufferAdcTime;
102104
}
103105

104106
int callback(const void* input, void* output, frame_t frameCount

0 commit comments

Comments
 (0)