I've pushed this patch and the ref/unref patch On Wed, 2016-03-16 at 15:40 -0500, Jonathon Jongsma wrote: > Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> > > thanks for the documentation. > > > On Mon, 2016-03-14 at 17:50 +0100, Francois Gouget wrote: > > Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx> > > --- > > > > More are probably needed but at least those would have helped me when I > > started looking at this code. (As would renaming SndWorker to SndState > > and making it clearer it's a base class.) > > > > server/sound.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/server/sound.c b/server/sound.c > > index 03d88eb..1cc4cfa 100644 > > --- a/server/sound.c > > +++ b/server/sound.c > > @@ -79,6 +79,7 @@ typedef void > > (*snd_channel_cleanup_channel_proc)(SndChannel > > *channel); > > > > typedef struct SndWorker SndWorker; > > > > +/* Connects an audio channel to a Spice client */ > > struct SndChannel { > > RedsStream *stream; > > SndWorker *worker; > > @@ -131,18 +132,20 @@ struct PlaybackChannel { > > SndChannel base; > > AudioFrame frames[3]; > > AudioFrame *free_frames; > > - AudioFrame *in_progress; > > - AudioFrame *pending_frame; > > + AudioFrame *in_progress; /* Frame being sent to the client */ > > + AudioFrame *pending_frame; /* Next frame to send to the client */ > > uint32_t mode; > > uint32_t latency; > > SndCodec codec; > > uint8_t encode_buf[SND_CODEC_MAX_COMPRESSED_BYTES]; > > }; > > > > +/* Base class for SpicePlaybackState and SpiceRecordState */ > > struct SndWorker { > > RedChannel *base_channel; > > - SndChannel *connection; > > - SndWorker *next; > > + SndChannel *connection; /* Only one client is supported */ > > + SndWorker *next; /* For the global SndWorker list */ > > + > > int active; > > }; > > > > @@ -178,6 +181,7 @@ typedef struct RecordChannel { > > uint8_t decode_buf[SND_CODEC_MAX_FRAME_BYTES]; > > } RecordChannel; > > > > +/* A list of all Spice{Playback,Record}State objects */ > > static SndWorker *workers; > > static uint32_t playback_compression = TRUE; > > > _______________________________________________ > Spice-devel mailing list > Spice-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/spice-devel _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel