X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmodules%2Fbluetooth%2Fmodule-bluetooth-device.c;h=6d2679dd89401c788d7ca5563ef9845aa4530adf;hb=95422110ba2492d1e8b466b3bc0592eaa8b895ec;hp=bbd57ed4273b687d77461ebc5bcbfadf207eeb99;hpb=adb16f9ff42008c5b8f76133d8879fc15a82533f;p=profile%2Fivi%2Fpulseaudio.git diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index bbd57ed..6d2679d 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -2156,6 +2156,8 @@ static int bt_transport_config_a2dp(struct userdata *u) { config = (a2dp_sbc_t *) t->config; + u->sample_spec.format = PA_SAMPLE_S16LE; + if (a2dp->sbc_initialized) sbc_reinit(&a2dp->sbc, 0); else @@ -2165,15 +2167,19 @@ static int bt_transport_config_a2dp(struct userdata *u) { switch (config->frequency) { case BT_SBC_SAMPLING_FREQ_16000: a2dp->sbc.frequency = SBC_FREQ_16000; + u->sample_spec.rate = 16000U; break; case BT_SBC_SAMPLING_FREQ_32000: a2dp->sbc.frequency = SBC_FREQ_32000; + u->sample_spec.rate = 32000U; break; case BT_SBC_SAMPLING_FREQ_44100: a2dp->sbc.frequency = SBC_FREQ_44100; + u->sample_spec.rate = 44100U; break; case BT_SBC_SAMPLING_FREQ_48000: a2dp->sbc.frequency = SBC_FREQ_48000; + u->sample_spec.rate = 48000U; break; default: pa_assert_not_reached(); @@ -2182,15 +2188,19 @@ static int bt_transport_config_a2dp(struct userdata *u) { switch (config->channel_mode) { case BT_A2DP_CHANNEL_MODE_MONO: a2dp->sbc.mode = SBC_MODE_MONO; + u->sample_spec.channels = 1; break; case BT_A2DP_CHANNEL_MODE_DUAL_CHANNEL: a2dp->sbc.mode = SBC_MODE_DUAL_CHANNEL; + u->sample_spec.channels = 2; break; case BT_A2DP_CHANNEL_MODE_STEREO: a2dp->sbc.mode = SBC_MODE_STEREO; + u->sample_spec.channels = 2; break; case BT_A2DP_CHANNEL_MODE_JOINT_STEREO: a2dp->sbc.mode = SBC_MODE_JOINT_STEREO; + u->sample_spec.channels = 2; break; default: pa_assert_not_reached(); @@ -2257,6 +2267,9 @@ static int bt_transport_config_a2dp(struct userdata *u) { static int bt_transport_config(struct userdata *u) { if (u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW) { u->block_size = u->link_mtu; + u->sample_spec.format = PA_SAMPLE_S16LE; + u->sample_spec.channels = 1; + u->sample_spec.rate = 8000; return 0; }