summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2018-04-25 16:20:34 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2018-04-25 17:43:27 +0900
commitf92ad5d201ab8e3f4c39d96d9ec92d2029755551 (patch)
tree806e42dd4fe9a8bcb2e77c968223d11f41772809
parentafe8eb8c5e8124f6140813c758d460dd3be8849d (diff)
downloadlibmm-radio-f92ad5d201ab8e3f4c39d96d9ec92d2029755551.tar.gz
libmm-radio-f92ad5d201ab8e3f4c39d96d9ec92d2029755551.tar.bz2
libmm-radio-f92ad5d201ab8e3f4c39d96d9ec92d2029755551.zip
Change the thread running flag before send message.submit/tizen/20180425.085112accepted/tizen/unified/20180426.062535
seek complete callback is called but, radio seek running flag is true [Version] 0.2.40 [Profile] Mobile, Wearable [Issue Type] Fix bugs Change-Id: Ic32c1f7abeae521af3608ecfe042e0f64f729662
-rwxr-xr-xpackaging/libmm-radio.spec2
-rw-r--r--src/mm_radio_priv_emulator.c16
-rw-r--r--src/mm_radio_priv_hal.c18
3 files changed, 18 insertions, 18 deletions
diff --git a/packaging/libmm-radio.spec b/packaging/libmm-radio.spec
index c6bf627..b94b983 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.39
+Version: 0.2.40
Release: 0
Group: System/Libraries
License: Apache-2.0
diff --git a/src/mm_radio_priv_emulator.c b/src/mm_radio_priv_emulator.c
index 6234fda..ff3a9a6 100644
--- a/src/mm_radio_priv_emulator.c
+++ b/src/mm_radio_priv_emulator.c
@@ -988,13 +988,16 @@ FINISHED:
}
}
- if (!p_thread->stop)
- __mmradio_msg_push(radio, MM_RADIO_MSG_SCAN_FINISHED, 0);
- else
+ p_thread->is_running = false;
+
+ if (p_thread->stop)
__mmradio_msg_push(radio, MM_RADIO_MSG_SCAN_STOPPED, 0);
+ else
+ __mmradio_msg_push(radio, MM_RADIO_MSG_SCAN_FINISHED, 0);
- p_thread->is_running = false;
+ /* reset thread stop flag */
p_thread->stop = false;
+
}
EXIT:
@@ -1106,9 +1109,9 @@ void __mmradio_seek_thread(mm_radio_t * radio)
radio->prev_seek_freq = freq;
MMRADIO_LOG_INFO("seeking : new frequency : [%d]", (int) freq);
+ p_thread->is_running = false;
__mmradio_msg_push(radio, MM_RADIO_MSG_SEEK_FINISHED, freq);
p_thread->stop = true;
- p_thread->is_running = false;
continue;
SEEK_FAILED:
@@ -1592,9 +1595,6 @@ static void __mmradio_destroy_thread_type(mm_radio_t *radio, MMRadioThreadTypes
pthread_join(p_thread->thread, NULL);
p_thread->thread = 0;
break;
- default:
- MMRADIO_LOG_WARNING("(%d)type isn't handled", type);
- break;
}
} else {
MMRADIO_LOG_WARNING("(%d)thread is zero", type);
diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c
index ac1cd92..f875a77 100644
--- a/src/mm_radio_priv_hal.c
+++ b/src/mm_radio_priv_hal.c
@@ -1009,12 +1009,15 @@ FINISHED_ERR:
MMRADIO_SET_STATE(radio, MM_RADIO_STATE_READY);
}
- if (!p_thread->stop)
- __mmradio_msg_push(radio, MM_RADIO_MSG_SCAN_FINISHED, 0);
- else
+ p_thread->is_running = false;
+
+ if (p_thread->stop)
__mmradio_msg_push(radio, MM_RADIO_MSG_SCAN_STOPPED, 0);
+ else
+ __mmradio_msg_push(radio, MM_RADIO_MSG_SCAN_FINISHED, 0);
- p_thread->is_running = false;
+ /* reset thread stop flag */
+ p_thread->stop = false;
}
@@ -1141,8 +1144,8 @@ void __mmradio_seek_thread(mm_radio_t *radio)
radio->prev_seek_freq = (int)freq;
MMRADIO_LOG_INFO("seeking : new frequency : [%d]", (int) freq);
- __mmradio_msg_push(radio, MM_RADIO_MSG_SEEK_FINISHED, freq);
p_thread->is_running = false;
+ __mmradio_msg_push(radio, MM_RADIO_MSG_SEEK_FINISHED, freq);
continue;
SEEK_FAILED:
@@ -1156,9 +1159,9 @@ SEEK_FAILED:
MMRADIO_LOG_ERROR("failed to set unmute radio hal");
radio->seek_unmute = false;
}
+ p_thread->is_running = false;
/* freq -1 means it's failed to seek */
__mmradio_msg_push(radio, MM_RADIO_MSG_SEEK_FINISHED, -1);
- p_thread->is_running = false;
}
EXIT:
@@ -1647,9 +1650,6 @@ static void __mmradio_destroy_thread_type(mm_radio_t *radio, MMRadioThreadTypes
pthread_join(p_thread->thread, NULL);
p_thread->thread = 0;
break;
- default:
- MMRADIO_LOG_WARNING("(%d)type isn't handled", type);
- break;
}
} else {
MMRADIO_LOG_WARNING("(%d)thread is zero", type);