Ticket #3 (closed defect: fixed)

Opened 2 years ago

Last modified 9 months ago

timeInfo->currentTime is unimplemented in the buffer processor (pa_process.c)

Reported by: bjornroche Owned by: rossb
Priority: critical Milestone: V19-RC1
Component: common Version:
Keywords: timeInfo->currentTime buffer processor time Cc:

Description

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;
}

Change History

Changed 2 years ago by rossb

  • priority changed from minor to major

Changed 9 months ago by rossb

  • priority changed from major to critical
  • status changed from new to assigned

Changed 9 months ago by rossb

  • status changed from assigned to closed
  • resolution set to fixed

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.

Changed 9 months ago by rossb

Patched in changeset r1341

Note: See TracTickets for help on using tickets.