core-format: Add pa_format_info_get_channels()

This also fixes an issue in pa_format_info_to_sample_spec(): it did
no validation for the channels value. Now the validation is taken care
of in pa_format_info_get_channels().
This commit is contained in:
Tanu Kaskinen 2013-11-25 14:51:37 +02:00
parent 85a3f560d1
commit 066dd942aa
3 changed files with 27 additions and 4 deletions

View file

@ -32,6 +32,11 @@ int pa_format_info_get_sample_format(pa_format_info *f, pa_sample_format_t *sf);
* -PA_ERR_NOENTITY. */
int pa_format_info_get_rate(pa_format_info *f, uint32_t *rate);
/* Gets the channel count stored in the format info. Returns a negative error
* code on failure. If the channels property is not set at all, returns
* -PA_ERR_NOENTITY. */
int pa_format_info_get_channels(pa_format_info *f, uint8_t *channels);
/* For compressed formats. Converts the format info into a sample spec and a
* channel map that an ALSA device can use as its configuration parameters when
* playing back the compressed data. That is, the returned sample spec doesn't