summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2017-02-22 20:09:15 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2017-02-23 19:33:17 +0900
commitb1b635792c09e8fa3f758a8bc9b85d5d49f2116d (patch)
tree3d9eb1f206bfced14b15bae8302533603ce71545
parent6ebdd69081e06c5888eefe785f0c2c37062c483f (diff)
downloadlibmm-radio-b1b635792c09e8fa3f758a8bc9b85d5d49f2116d.tar.gz
libmm-radio-b1b635792c09e8fa3f758a8bc9b85d5d49f2116d.tar.bz2
libmm-radio-b1b635792c09e8fa3f758a8bc9b85d5d49f2116d.zip
Reset radio focus cb type
Somtimes an unintended interrupt callback is called. [Version] 0.2.2 [Profile] Mobile, Wearable [Issue Type] Fix bugs Change-Id: I5633d92eed01504d74d59b8c3d6b33aeaf5063de
-rwxr-xr-xpackaging/libmm-radio.spec2
-rw-r--r--src/mm_radio_priv_hal.c12
-rw-r--r--src/mm_radio_sound_focus.c1
3 files changed, 8 insertions, 7 deletions
diff --git a/packaging/libmm-radio.spec b/packaging/libmm-radio.spec
index 1c59636..4c31c5e 100755
--- a/packaging/libmm-radio.spec
+++ b/packaging/libmm-radio.spec
@@ -1,6 +1,6 @@
Name: libmm-radio
Summary: Multimedia Framework Radio Library
-Version: 0.2.21
+Version: 0.2.22
Release: 0
Group: System/Libraries
License: Apache-2.0
diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c
index 82afebb..e9752ae 100644
--- a/src/mm_radio_priv_hal.c
+++ b/src/mm_radio_priv_hal.c
@@ -924,19 +924,16 @@ void __mmradio_scan_thread(mm_radio_t *radio)
if (ret != MM_ERROR_NONE) {
MMRADIO_LOG_ERROR("failed to get current frequency");
} else {
- if (freq < prev_freq) {
- MMRADIO_LOG_DEBUG("scanning wrapped around. stopping scan");
+ if (freq <= prev_freq) {
+ MMRADIO_LOG_ERROR("frequency is less than previous [%d] -> [%d] we wrapped around, we are finished scanning", prev_freq, freq);
break;
}
- if (freq == prev_freq)
- continue;
-
prev_freq = param.radio_scan.frequency = (int)freq;
MMRADIO_LOG_INFO("scanning : new frequency : [%d]", param.radio_scan.frequency);
/* drop if max freq is scanned */
- if (param.radio_scan.frequency == radio->region_setting.band_max) {
+ if (param.radio_scan.frequency >= radio->region_setting.band_max) {
MMRADIO_LOG_WARNING("%d freq is dropping...and stopping scan", param.radio_scan.frequency);
break;
}
@@ -1372,6 +1369,8 @@ static void __mmradio_sound_focus_cb(int id, mm_sound_focus_type_e focus_type,
if (result)
MMRADIO_LOG_ERROR("failed to stop radio");
+ radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
+
MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d", radio->sound_focus.cur_focus_type);
}
break;
@@ -1424,6 +1423,7 @@ static void __mmradio_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_t
result = _mmradio_stop(radio);
if (result)
MMRADIO_LOG_ERROR("failed to stop radio");
+ radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type);
}
diff --git a/src/mm_radio_sound_focus.c b/src/mm_radio_sound_focus.c
index 696bc8f..766a913 100644
--- a/src/mm_radio_sound_focus.c
+++ b/src/mm_radio_sound_focus.c
@@ -54,6 +54,7 @@ static void _mmradio_device_connected_cb(MMSoundDevice_t device, bool is_connect
result = _mmradio_stop(radio);
if (result != MM_ERROR_NONE)
MMRADIO_LOG_ERROR("failed to stop radio");
+ radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
}
break;
default: