On Tue, 2015-12-29 at 09:03 +0530, arun at accosted.net wrote: > @@ -1195,8 +1198,10 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag, > Â Â Â Â Â Â Â Â Â } > Â Â Â Â Â } > Â > -Â Â Â Â if (s->context->version >= 31) > +Â Â Â Â if (s->context->version >= 31) { > Â Â Â Â Â Â Â Â Â pa_tagstruct_get_cvolume(t, &s->volume); > +Â Â Â Â Â Â Â Â pa_tagstruct_get_boolean(t, &s->mute); The pa_tagstruct_get_boolean() return value needs to be checked. > +int pa_stream_get_mute(pa_stream *s, int *mute) { > +Â Â Â Â pa_assert(s); > +Â Â Â Â pa_assert(mute); > +Â Â Â Â pa_assert(PA_REFCNT_VALUE(s) >= 1); > + > +Â Â Â Â PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED); > +Â Â Â Â PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE); > +Â Â Â Â PA_CHECK_VALIDITY(s->context, s->state != PA_STREAM_FAILED && s->state != PA_STREAM_TERMINATED, PA_ERR_BADSTATE); > +Â Â Â Â PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_NODATA); The second and third s->state checks can be removed, because the first check already covers all cases. > +Â Â Â Â PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_INVALID); /* TODO: do we want to support this? */ No, we don't. > +/** Get the mute status on the given stream. > + * > + * Returns 0 on success, negative error value on failure. > + * > + * \since 9.0 */ > +int pa_stream_get_mute(pa_stream *s, int *mute); It should be documented that this works only with protocol version >= 31. -- Tanu