((radio_scan_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_FINISH]);
break;
case MM_MESSAGE_RADIO_SEEK_FINISH:
- if (handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH])
+ if (handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH]) {
((radio_seek_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SEEK_FINISH]);
+ handle->seeking = false;
+ }
break;
case MM_MESSAGE_STATE_INTERRUPTED:
if (msg->union_type == MM_MSG_UNION_STATE) {
return __convert_error_code(ret, (char *)__FUNCTION__);
handle->state = RADIO_STATE_READY;
- handle->mute = FALSE;
+ handle->mute = false;
+ handle->seeking = false;
return RADIO_ERROR_NONE;
}
}
radio_s *handle = (radio_s *)radio;
RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
+ if (handle->seeking) {
+ LOGI("radio is seeking, can't serve another request try again");
+ return RADIO_ERROR_INVALID_OPERATION;
+ }
+
+ handle->seeking = true;
+
if (callback != NULL)
__set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio, callback, user_data);
else
radio_s *handle = (radio_s *)radio;
RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
+ if (handle->seeking) {
+ LOGI("radio is seeking, can't serve another request try again");
+ return RADIO_ERROR_INVALID_OPERATION;
+ }
+
+ handle->seeking = true;
+
if (callback != NULL)
__set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio, callback, user_data);
else