diff options
author | Colin Guthrie <colin@mageia.org> | 2011-05-17 21:56:10 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2011-06-22 21:55:27 +0100 |
commit | 5d35375aa758fde7d9f3d6467e2506aca9784597 (patch) | |
tree | 13a5eef2e1a06d0d5a9a76a83f0c90d085819e06 /src/pulse | |
parent | 30597b7c2747a52b1025e1172d73825e148fdec9 (diff) |
capture: Add the passthrough format negotiation to capture streams.
This helps to keep the API more symmetrical and also potentially
allows support for passthrough monitor sources at some point in the future.
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/stream.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/pulse/stream.c b/src/pulse/stream.c index aeb897c2..32936848 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -1092,7 +1092,9 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag, s->timing_info.configured_sink_usec = usec; } - if (s->context->version >= 21 && s->direction == PA_STREAM_PLAYBACK) { + if ((s->context->version >= 21 && s->direction == PA_STREAM_PLAYBACK) + || s->context->version >= 22) { + pa_format_info *f = pa_format_info_new(); pa_tagstruct_get_format_info(t, f); @@ -1319,26 +1321,18 @@ static int create_stream( pa_tagstruct_put_boolean(t, flags & PA_STREAM_FAIL_ON_SUSPEND); } - if (s->context->version >= 17) { - - if (s->direction == PA_STREAM_PLAYBACK) - pa_tagstruct_put_boolean(t, flags & PA_STREAM_RELATIVE_VOLUME); - - } - - if (s->context->version >= 18) { + if (s->context->version >= 17 && s->direction == PA_STREAM_PLAYBACK) + pa_tagstruct_put_boolean(t, flags & PA_STREAM_RELATIVE_VOLUME); - if (s->direction == PA_STREAM_PLAYBACK) - pa_tagstruct_put_boolean(t, flags & (PA_STREAM_PASSTHROUGH)); - } + if (s->context->version >= 18 && s->direction == PA_STREAM_PLAYBACK) + pa_tagstruct_put_boolean(t, flags & (PA_STREAM_PASSTHROUGH)); - if (s->context->version >= 21) { + if ((s->context->version >= 21 && s->direction == PA_STREAM_PLAYBACK) + || s->context->version >= 22) { - if (s->direction == PA_STREAM_PLAYBACK) { - pa_tagstruct_putu8(t, s->n_formats); - for (i = 0; i < s->n_formats; i++) - pa_tagstruct_put_format_info(t, s->req_formats[i]); - } + pa_tagstruct_putu8(t, s->n_formats); + for (i = 0; i < s->n_formats; i++) + pa_tagstruct_put_format_info(t, s->req_formats[i]); } pa_pstream_send_tagstruct(s->context->pstream, t); |