Since the __mId member can be initial value(-1) when this function is called from onSignal() in
CAudioIO.cpp, it should not throw an error even if the value is under 0.
[Version] 0.3.44
[Profile] Common
[Issue Type] Bug Fix
Change-Id: I02548ee2df164bd253bb9744537b1c490ff5b244
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
Release: 0
Group: Multimedia/API
License: Apache-2.0
Release: 0
Group: Multimedia/API
License: Apache-2.0
unsigned int subscribe_id;
int errorCode = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &subscribe_id, __sound_pcm_signal_cb, static_cast<void*>(this));
if (errorCode != MM_ERROR_NONE) {
unsigned int subscribe_id;
int errorCode = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &subscribe_id, __sound_pcm_signal_cb, static_cast<void*>(this));
if (errorCode != MM_ERROR_NONE) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_subscribe_signal() err:0x%x", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_subscribe_signal() err:0x%x", errorCode);
}
__mSubscribeId = (int)subscribe_id;
}
__mSubscribeId = (int)subscribe_id;
errorCode = mm_sound_focus_get_id(&__mId);
if (errorCode != MM_ERROR_NONE) {
errorCode = mm_sound_focus_get_id(&__mId);
if (errorCode != MM_ERROR_NONE) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_focus_get_id() err:0x%x", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_focus_get_id() err:0x%x", errorCode);
}
// Register focus callback
}
// Register focus callback
__sound_pcm_focus_cb,
static_cast<void*>(this));
if (errorCode != MM_ERROR_NONE) {
__sound_pcm_focus_cb,
static_cast<void*>(this));
if (errorCode != MM_ERROR_NONE) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_register_focus_for_session() err:0x%x", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_register_focus_for_session() err:0x%x", errorCode);
// Register focus watch callback
errorCode = mm_sound_set_focus_watch_callback_for_session(getpid(), FOCUS_FOR_BOTH, __sound_pcm_focus_watch_cb, static_cast<void*>(this), &__mId);
if (errorCode < 0) {
// Register focus watch callback
errorCode = mm_sound_set_focus_watch_callback_for_session(getpid(), FOCUS_FOR_BOTH, __sound_pcm_focus_watch_cb, static_cast<void*>(this), &__mId);
if (errorCode < 0) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_set_focus_watch_callback_for_session() err:0x%x", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_set_focus_watch_callback_for_session() err:0x%x", errorCode);
THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioSessionHandler");
}
THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioSessionHandler");
}
- if (__mUseFocus == true) {
- if (__mId < 0) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Did not register [id:%d]", __mId);
- }
-
+ if (__mUseFocus == true && __mId >= 0) {
int errorCode = 0;
if (__isFocusRequired(__mMultimediaSession, __mOptions)) {
// Unregister focus callback
errorCode = mm_sound_unregister_focus(__mId);
if (errorCode != MM_ERROR_NONE) {
int errorCode = 0;
if (__isFocusRequired(__mMultimediaSession, __mOptions)) {
// Unregister focus callback
errorCode = mm_sound_unregister_focus(__mId);
if (errorCode != MM_ERROR_NONE) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_unregister_focus() err:0x%x", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_unregister_focus() err:0x%x", errorCode);
// Unregister focus watch callback.
errorCode = mm_sound_unset_focus_watch_callback(__mId);
if (errorCode < 0) {
// Unregister focus watch callback.
errorCode = mm_sound_unset_focus_watch_callback(__mId);
if (errorCode < 0) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_unset_focus_watch_callback() err:0x%x", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_unset_focus_watch_callback() err:0x%x", errorCode);
if (__mId >= 0) {
int ret = mm_sound_release_focus(__mId, FOCUS_FOR_BOTH, "audio-io release focus");
if (ret != MM_ERROR_NONE) {
if (__mId >= 0) {
int ret = mm_sound_release_focus(__mId, FOCUS_FOR_BOTH, "audio-io release focus");
if (ret != MM_ERROR_NONE) {
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_release_focus() err:0x%x", ret);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed mm_sound_release_focus() err:0x%x", ret);
}
AUDIO_IO_LOGD("Focus released successfully [id:%d]", __mId);
}
}
AUDIO_IO_LOGD("Focus released successfully [id:%d]", __mId);
}