From 1ce097dbb0577074ada08fefb78df51a76c2ab08 Mon Sep 17 00:00:00 2001 From: Dario Casalinuovo Date: Thu, 30 Jul 2015 13:15:05 +0200 Subject: [PATCH] BMediaRoster: Wait with more calm for services to be up. * Needed to avoid the app restarting things too fast. This is a problem that should be solved, added a TODO. --- src/kits/media/MediaRoster.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index 22de1accef..e386c2d0fb 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -3377,6 +3377,11 @@ BMediaRoster::MessageReceived(BMessage* message) // Send the notification to our subscribers if (BMediaRoster::IsRunning()) { sServerIsUp = true; + // Wait for media services to wake up + // TODO: This should be solved so that the server + // have a way to notify us when the system is really + // ready to run and we avoid sleeping. + snooze(2000000); // Restore our friendship with the media servers if (MediaRosterEx(this)->BuildConnections() != B_OK) { TRACE("BMediaRoster::MessageReceived can't reconnect"