summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);