diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-03-02 12:54:02 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-05-02 11:55:35 +0530 |
commit | e11770b64ffbe0a5e5d172244c175fa0bc4034db (patch) | |
tree | afd0b5fe072c7b909ad905b92fc4611c0b505632 /src/pulsecore/protocol-native.c | |
parent | 658a9153f094db9a30ac94428f4e46985e7096eb (diff) |
core: Fix some FIXMEs for the extended API
This adds some checks that I'd postponed and adds a
"should-be-good-enough" guess for tlength when using a compressed
format.
Diffstat (limited to 'src/pulsecore/protocol-native.c')
-rw-r--r-- | src/pulsecore/protocol-native.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index ee2bc4f5..956670be 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -2008,10 +2008,15 @@ static void command_create_playback_stream(pa_pdispatch *pd, uint32_t command, u } } - CHECK_VALIDITY(c->pstream, n_formats > 0 || pa_sample_spec_valid(&ss), tag, PA_ERR_INVALID); - CHECK_VALIDITY(c->pstream, n_formats > 0 || (map.channels == ss.channels && volume.channels == ss.channels), tag, PA_ERR_INVALID); - CHECK_VALIDITY(c->pstream, n_formats > 0 || pa_channel_map_valid(&map), tag, PA_ERR_INVALID); - /* XXX: add checks on formats. At least inverse checks of the 3 above */ + if (n_formats == 0) { + CHECK_VALIDITY(c->pstream, pa_sample_spec_valid(&ss), tag, PA_ERR_INVALID); + CHECK_VALIDITY(c->pstream, map.channels == ss.channels && volume.channels == ss.channels, tag, PA_ERR_INVALID); + CHECK_VALIDITY(c->pstream, pa_channel_map_valid(&map), tag, PA_ERR_INVALID); + } else { + PA_IDXSET_FOREACH(format, formats, i) { + CHECK_VALIDITY(c->pstream, pa_format_info_valid(format), tag, PA_ERR_INVALID); + } + } if (!pa_tagstruct_eof(t)) { protocol_error(c); |