diff options
-rw-r--r-- | libasound.c | 21 | ||||
-rw-r--r-- | stubs.h | 1 |
2 files changed, 21 insertions, 1 deletions
diff --git a/libasound.c b/libasound.c index 8aff21e..26329f9 100644 --- a/libasound.c +++ b/libasound.c @@ -978,4 +978,25 @@ snd_pcm_get_params(snd_pcm_t *pcm, snd_pcm_uframes_t *buffer_size, snd_pcm_ufram return 0; } +snd_pcm_chmap_t* +snd_pcm_get_chmap(snd_pcm_t *pcm) +{ + const unsigned int nc = (pcm->stream == SND_PCM_STREAM_PLAYBACK ? pcm->hw.par.pchan : pcm->hw.par.rchan); + + snd_pcm_chmap_t *map; + if (!(map = calloc(1, sizeof(*map) + nc))) + return NULL; + + map->channels = nc; + + if (nc == 1) { + map->pos[0] = SND_CHMAP_MONO; + } else if (nc == 2) { + map->pos[0] = SND_CHMAP_FL; + map->pos[1] = SND_CHMAP_FR; + } + + return map; +} + #include "symversioning-hell.h" @@ -509,7 +509,6 @@ int snd_pcm_unlink(snd_pcm_t *pcm) { WARNX1("stub"); return 0; } snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm) { WARNX1("stub"); return NULL; } snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev, snd_pcm_stream_t stream) { WARNX1("stub"); return NULL; } void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps) { WARNX1("stub"); } -snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm) { WARNX1("stub"); return NULL; } int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map) { WARNX1("stub"); return 0; } const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val) { WARNX1("stub"); return NULL; } const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val) { WARNX1("stub"); return NULL; } |