On Tue, 2015-12-29 at 09:03 +0530, [email protected] 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
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss