int32 DSClockSync (DSStreamCBPtr streamCBPtr, MemPoolPtr msgPoolPtr,
unsigned long nowTime)
DSClockSync()
defines a subscriber message
subMsg
containing the new time value, then calls
DSSetClock()
directly to reset the DataStreamer clock and
broadcasts the synchronization message to the subscribers. The broadcast
of the synchronization message is asynchronous to the completion of
DSClockSync()
.
DSClockSync()
uses the pool of messages specified by
msgPoolPtr
, allocating a synchronization message for each
subscriber to the specified stream.
Clock time in the DataStreamer is measured in standard Portfolio audio clock ticks (the DataStreamer does not change the rate of the audio clock or the duration of audio ticks). Since the DataStreamer does not own the audio clock, however, external tasks can affect the DataStreamer clock by altering the state of the audio clock.
Since the DataStreamer and acquisition threads determine stream
positioning and data flushing by the DataStreamer clock, resetting the
clock can affect the loading of streamed data chunks adversely. The
DataStreamer clock is normally reset only when a new stream is opened.
Streams can be started and stopped without requiring the DataStreamer
clock to be reset (see DSStartStream()
and
DSStopStream()
).
The Control subscriber usually synchronizes the clock. Any subscriber, however, may set the clock (the audio subscriber normally sets the clock).
streamCBPtr
msgPoolPtr
nowTime
streamCBPtr.
subMsg
are set to the following
values:
subMsg.whatToDo
- kStreamOpSync
subMsg.privatePtr
- NULL
subMsg.msg.sync.clock
- nowTime
kDSNotRunning
kDSNoMsgErr
kDSNoReplyPortErr
SendMsg()
failed
SendMsg()
.
DSSetClock
,
OwnAudioClock,
SendMsg