timeInfo->currentTime is unimplemented in the buffer processor (pa_process.c)
Hosts that use the buffer processor, including Core Audio, do not pass a meaningful value to clients for timeInfo->currentTime because the buffer processor zeros it out. The code looks like it would be easy to fix:
void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bp,
PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags )
{
bp->timeInfo = timeInfo;
/* the first streamCallback will be called to process samples which are
currently in the input buffer before the ones starting at the timeInfo time */
bp->timeInfo->inputBufferAdcTime -= bp->framesInTempInputBuffer * bp->samplePeriod;
bp->timeInfo->currentTime = 0; /** FIXME: @todo time info currentTime not implemented */
/* the first streamCallback will be called to generate samples which will be
outputted after the frames currently in the output buffer have been
outputted. */
bp->timeInfo->outputBufferDacTime += bp->framesInTempOutputBuffer * bp->samplePeriod;
bp->callbackStatusFlags = callbackStatusFlags;
bp->hostInputFrameCount[1] = 0;
bp->hostOutputFrameCount[1] = 0;
}
Leave a comment
Resolved the bug by removing the code which zeros timeInfo->currentTime. As noted in the patch:
/*
We just pass through timeInfo->currentTime provided by the caller. This is
not strictly conformant to the word of the spec, since the buffer processor
might call the callback multiple times, and we never refresh currentTime.
*/
A new ticket will be added for this issue.
/*
We just pass through timeInfo->currentTime provided by the caller. This is
not strictly conformant to the word of the spec, since the buffer processor
might call the callback multiple times, and we never refresh currentTime.
*/
A new ticket will be added for this issue.