Fixing notification dequeing.
This commit is contained in:
parent
e186fcaf0d
commit
7f62e8a86d
|
@ -130,6 +130,7 @@ X_RESULT XXMPApp::XMPPlayTitlePlaylist(uint32_t playlist_handle,
|
||||||
active_song_index_ = 0;
|
active_song_index_ = 0;
|
||||||
state_ = State::kPlaying;
|
state_ = State::kPlaying;
|
||||||
OnStateChanged();
|
OnStateChanged();
|
||||||
|
kernel_state_->BroadcastNotification(kMsgPlaybackBehaviorChanged, 1);
|
||||||
return X_ERROR_SUCCESS;
|
return X_ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,9 @@ bool XNotifyListener::DequeueNotification(XNotificationID id,
|
||||||
std::lock_guard<xe::mutex> lock(lock_);
|
std::lock_guard<xe::mutex> lock(lock_);
|
||||||
bool dequeued = false;
|
bool dequeued = false;
|
||||||
if (notification_count_) {
|
if (notification_count_) {
|
||||||
dequeued = true;
|
|
||||||
auto it = notifications_.find(id);
|
auto it = notifications_.find(id);
|
||||||
if (it != notifications_.end()) {
|
if (it != notifications_.end()) {
|
||||||
|
dequeued = true;
|
||||||
*out_data = it->second;
|
*out_data = it->second;
|
||||||
notifications_.erase(it);
|
notifications_.erase(it);
|
||||||
notification_count_--;
|
notification_count_--;
|
||||||
|
|
|
@ -75,6 +75,9 @@ SHIM_CALL XNotifyGetNext_shim(PPCContext* ppc_context,
|
||||||
if (dequeued) {
|
if (dequeued) {
|
||||||
SHIM_SET_MEM_32(id_ptr, id);
|
SHIM_SET_MEM_32(id_ptr, id);
|
||||||
SHIM_SET_MEM_32(param_ptr, param);
|
SHIM_SET_MEM_32(param_ptr, param);
|
||||||
|
} else {
|
||||||
|
SHIM_SET_MEM_32(id_ptr, 0);
|
||||||
|
SHIM_SET_MEM_32(param_ptr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SHIM_SET_RETURN_32(dequeued ? 1 : 0);
|
SHIM_SET_RETURN_32(dequeued ? 1 : 0);
|
||||||
|
|
Loading…
Reference in New Issue