summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJuha Heinanen <jh@tutpro.com>2016-10-24 16:49:27 +0300
committerJuha Heinanen <jh@tutpro.com>2016-10-24 16:49:27 +0300
commita71d0bf8541d4fc3d77c3105ea906a2759648d57 (patch)
tree934cb945ad822970ddf86ec6b93420d3dd26f01f /modules
parent8e2c4742db0e6da3a6aac63e7f5d2e6a9afda5e6 (diff)
opensles: for 2 channels, use mask SL_SPEAKER_FRONT_LEFT|SL_SPEAKER_FRONT_RIGHT
- original patch by Vijay Pratap Singh
Diffstat (limited to 'modules')
-rw-r--r--modules/opensles/player.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/opensles/player.c b/modules/opensles/player.c
index e007464..347240f 100644
--- a/modules/opensles/player.c
+++ b/modules/opensles/player.c
@@ -84,11 +84,14 @@ static int createPlayer(struct auplay_st *st, struct auplay_prm *prm)
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2
};
+ uint32_t ch_mask = prm->ch == 2
+ ? SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT
+ : SL_SPEAKER_FRONT_CENTER;
SLDataFormat_PCM format_pcm = {SL_DATAFORMAT_PCM, prm->ch,
prm->srate * 1000,
SL_PCMSAMPLEFORMAT_FIXED_16,
SL_PCMSAMPLEFORMAT_FIXED_16,
- SL_SPEAKER_FRONT_CENTER,
+ ch_mask,
SL_BYTEORDER_LITTLEENDIAN};
SLDataSource audioSrc = {&loc_bufq, &format_pcm};
SLDataLocator_OutputMix loc_outmix = {