On 27. 05. 24 13:10, Takashi Iwai wrote:
On Mon, 27 May 2024 12:13:30 +0200,
Amadeusz Sławiński wrote:
+static int snd_compr_task_status(struct snd_compr_stream *stream,
+ struct snd_compr_task_status *status)
+{
+ struct snd_compr_task_runtime *task;
+
+ task = snd_compr_find_task(stream, status->seqno);
+ if (task == NULL)
+ return -EINVAL;
+ status->output_size = task->output_size;
+ status->active = task->active ? 1 : 0;
+ status->finished = task->finished ? 1 : 0;
Not sure, but access to ->active and ->finished, feels to me like
something that may require locking.
Or better to make it a single state field?
Yes, it's an option. Those states cannot be used simultaneously. Note that the
access to the runtime task fields is protected by the stream->device->lock
mutex. Unless I overlooked something.
Jaroslav
--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
[Index of Archives]
[Pulseaudio]
[Linux Audio Users]
[ALSA Devel]
[Fedora Desktop]
[Fedora SELinux]
[Big List of Linux Books]
[Yosemite News]
[KDE Users]