diff --git a/headers/os/media/MediaRoster.h b/headers/os/media/MediaRoster.h index 8030016213..72ee0aca84 100644 --- a/headers/os/media/MediaRoster.h +++ b/headers/os/media/MediaRoster.h @@ -44,10 +44,6 @@ public: // Check if the media services are running. static bool IsRunning(); - // Wait until the media_server is running or the specified timeout - // is reached. - status_t SyncToServices(bigtime_t timeout); - // Getting common instances of system nodes: status_t GetVideoInput(media_node* _node); status_t GetAudioInput(media_node* _node); diff --git a/src/kits/media/MediaDefs.cpp b/src/kits/media/MediaDefs.cpp index 2084e26e82..1eb4803cb9 100644 --- a/src/kits/media/MediaDefs.cpp +++ b/src/kits/media/MediaDefs.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1433,18 +1434,7 @@ launch_media_server(bigtime_t timeout, progress_startup(50, progress, cookie); - err = roster->SyncToServices(2000000); - if (err != B_OK) { - // At this point, it might be that the launch_daemon isn't - // restarting us, then we'll attempt at launching the server - // ourselves. - err = be_roster->Launch(B_MEDIA_SERVER_SIGNATURE); - if (err != B_OK) - return err; - - if (roster->SyncToServices(2000000) != B_OK) - err = B_MEDIA_SYSTEM_FAILURE; - } + err = BLaunchRoster().Start(B_MEDIA_SERVER_SIGNATURE); if (err != B_OK) progress_startup(90, progress, cookie); diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index 59e2f2c31f..613956cb58 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -112,7 +112,6 @@ static bool sServerIsUp = false; static List sNotificationList; static BLocker sInitLocker("BMediaRoster::Roster locker"); static List sRegisteredNodes; -static List sSyncedMessages; class MediaRosterUndertaker { @@ -3363,26 +3362,6 @@ BMediaRoster::IsRunning() } -status_t -BMediaRoster::SyncToServices(bigtime_t timeout) -{ - BMessenger messenger(this); - BMessage msg(MEDIA_ROSTER_REGISTER_SYNC); - BMessage reply; - - if (!messenger.IsValid()) - return B_MEDIA_SYSTEM_FAILURE; - - status_t ret = messenger.SendMessage(&msg, &reply, timeout, timeout); - if (ret == B_TIMED_OUT || reply.what == B_NO_REPLY) - return B_TIMED_OUT; - else if (ret != B_OK) - return ret; - - return B_OK; -} - - ssize_t BMediaRoster::AudioBufferSizeFor(int32 channelCount, uint32 sampleFormat, float frameRate, bus_type busKind) @@ -3471,20 +3450,6 @@ BMediaRoster::MessageReceived(BMessage* message) return; } - case MEDIA_ROSTER_REGISTER_SYNC: - { - BMessage reply; - if (sServerIsUp) - message->SendReply(&reply); - else { - DetachCurrentMessage(); - SyncedMessage msg; - msg.message = message; - sSyncedMessages.Insert(msg); - } - return; - } - case B_SOME_APP_LAUNCHED: { BString mimeSig; @@ -3552,16 +3517,6 @@ BMediaRoster::MessageReceived(BMessage* message) MediaRosterEx(this)->fLaunchNotification = false; } - BMessage reply; - for (int32 i = 0; i < sSyncedMessages.CountItems(); i++) { - SyncedMessage* msg; - if (sSyncedMessages.Get(i, &msg) == true) { - msg->message->SendReply(&reply); - delete msg->message; - } - sSyncedMessages.Remove(i); - } - // Send the notification to our subscribers for (int32 i = 0; i < sNotificationList.CountItems(); i++) { RosterNotification* current;