On Thu, 15 Mar 2018 13:56:27 +0100, twischer@de.adit-jv.com wrote:
From: Timo Wischer twischer@de.adit-jv.com
This variable will be used to exchange the status of the stream between the ALSA and JACK thread. In future commits it will also be used to signal DRAINING state from the ALSA to JACK thread and to signal XRUN state form the JACK to ALSA thread.
Therefore this internal state variable is not always in sync with io->state. In addition the internal state variable will be updated after the corresponding callback function was processed and not before the callback function was called (e.g. PREPARE and RUNNING).
Well, the fact that the state change is done for PREPARE before the plugin callback can be seen as a generic bug of ioplug. The best would be to fix in ioplug side.
And, the rest is RUNNING state. Is there anything else? For RUNNING, instead of keeping an internal shadow state, a saner way would be to have a jack->running bool flag indicating whether it's really running.
thanks,
Takashi