}
}
- 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:
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:
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);
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;
}
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:
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:
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);