diff options
author | Jaekyu Park <jk7744.park@samsung.com> | 2016-05-27 17:12:21 +0900 |
---|---|---|
committer | Jaekyu Park <jk7744.park@samsung.com> | 2016-05-27 17:12:21 +0900 |
commit | b268bc6b5e063575c9d1d2e3f6b68cc0eccdf4f5 (patch) | |
tree | 6ebb61536aca80727ce929cedb4634bac175503e | |
parent | 92ce1a7124e7073f8e19a9de7ca3c6d8bd143efd (diff) | |
download | libmm-sound-accepted/tizen_2.3.1_wearable.tar.gz libmm-sound-accepted/tizen_2.3.1_wearable.tar.bz2 libmm-sound-accepted/tizen_2.3.1_wearable.zip |
Tizen 2.4 SDK Rev6 Releasesubmit/tizen_2.3.1/20160530.021341accepted/tizen/2.3.1/wearable/20160530.053433accepted/tizen/2.3.1/mobile/20160530.053436tizen_2.3.1accepted/tizen_2.3.1_wearableaccepted/tizen_2.3.1_mobile
-rw-r--r-- | mm_sound_pcm.c | 25 | ||||
-rw-r--r-- | packaging/libmm-sound.spec | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/mm_sound_pcm.c b/mm_sound_pcm.c index 8e11481..cc35eda 100644 --- a/mm_sound_pcm.c +++ b/mm_sound_pcm.c @@ -356,6 +356,9 @@ int mm_sound_pcm_capture_open(MMSoundPcmHandle_t *handle, const unsigned int rat int errorcode = 0; int ret_mutex = 0; int ret = MM_ERROR_NONE; + int capture_h_count = 0; + int cur_session = MM_SESSION_TYPE_MEDIA; + int session_options = 0; int volume_config = 0; pa_sample_spec ss; @@ -454,9 +457,19 @@ int mm_sound_pcm_capture_open(MMSoundPcmHandle_t *handle, const unsigned int rat if(pcmHandle->handle<0) { result = pcmHandle->handle; debug_error("Device Open Error 0x%x\n", result); + if (pcmHandle->asm_handle) + ASM_unregister_sound(pcmHandle->asm_handle, pcmHandle->asm_event, &errorcode); PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); free(pcmHandle); PCM_CAPTURE_H_COUNT_DEC(); + PCM_CAPTURE_H_COUNT_GET(capture_h_count); + if (capture_h_count == 0) { + /* read session information */ + if(_mm_session_util_read_information(-1, &cur_session, &session_options) == 0) + if (cur_session == MM_SESSION_TYPE_MEDIA_RECORD) + _mm_session_util_write_information(-1, MM_SESSION_TYPE_MEDIA, session_options); + + } return result; } @@ -482,6 +495,9 @@ int mm_sound_pcm_capture_open_ex(MMSoundPcmHandle_t *handle, const unsigned int int result = MM_ERROR_NONE; int errorcode = 0; int ret_mutex = 0; + int capture_h_count = 0; + int cur_session = MM_SESSION_TYPE_MEDIA; + int session_options = 0; int volume_config = 0; pa_sample_spec ss; @@ -598,9 +614,18 @@ int mm_sound_pcm_capture_open_ex(MMSoundPcmHandle_t *handle, const unsigned int if(pcmHandle->handle<0) { result = pcmHandle->handle; debug_error("Device Open Error 0x%x\n", result); + if (pcmHandle->asm_handle) + ASM_unregister_sound(pcmHandle->asm_handle, pcmHandle->asm_event, &errorcode); PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); free(pcmHandle); PCM_CAPTURE_H_COUNT_DEC(); + PCM_CAPTURE_H_COUNT_GET(capture_h_count); + if (capture_h_count == 0) { + /* read session information */ + if(_mm_session_util_read_information(-1, &cur_session, &session_options) == 0) + if (cur_session == MM_SESSION_TYPE_MEDIA_RECORD) + _mm_session_util_write_information(-1, MM_SESSION_TYPE_MEDIA, session_options); + } return result; } diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 5c27929..85ea54e 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.9.189 +Version: 0.9.190 Release: 0 Group: System/Libraries License: Apache-2.0 |