If launching the media_addon_server via signature fails, try to launch it

from the current directory. The code was already there but commented out.
This fixes launching the media_addon_server from the liveCD. There was
a ticket, I think, but I can't find it right now.
Also reordered includes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33208 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2009-09-20 15:00:04 +00:00
parent 7914280cb8
commit 36e4aeea57
+19 -19
View File
@@ -31,28 +31,30 @@
char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 " char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 "
"Marcus Overhagen <[email protected]>"; "Marcus Overhagen <[email protected]>";
#include <Alert.h>
#include <Application.h> #include <Application.h>
#include <Autolock.h>
#include <Directory.h>
#include <Roster.h> #include <Roster.h>
#include <Messenger.h>
#include <MediaDefs.h> #include <MediaDefs.h>
#include <MediaFormats.h> #include <MediaFormats.h>
#include <Autolock.h> #include <Messenger.h>
#include <Alert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "MMediaFilesManager.h"
#include "NotificationManager.h"
#include "ServerInterface.h"
#include "DataExchange.h"
#include "BufferManager.h"
#include "NodeManager.h"
#include "AddOnManager.h" #include "AddOnManager.h"
#include "AppManager.h" #include "AppManager.h"
#include "BufferManager.h"
#include "DataExchange.h"
#include "FormatManager.h" #include "FormatManager.h"
#include "MediaMisc.h" #include "MediaMisc.h"
#include "media_server.h" #include "MMediaFilesManager.h"
#include "NodeManager.h"
#include "NotificationManager.h"
#include "ServerInterface.h"
#include "debug.h" #include "debug.h"
#include "media_server.h"
/* /*
* *
@@ -216,11 +218,14 @@ ServerApp::ArgvReceived(int32 argc, char **argv)
void void
ServerApp::StartAddonServer() ServerApp::StartAddonServer()
{ {
status_t err; // Try to launch media_addon_server by mime signature.
// If it fails (for example on the Live CD, where the executable
// hasn't yet been mimesetted), try from this application's
// directory
status_t err = be_roster->Launch(B_MEDIA_ADDON_SERVER_SIGNATURE);
if (err == B_OK)
return;
// launching media_addon_server from this application's directoy
// should no longer be needed, we now can launch by mime signature
/*
app_info info; app_info info;
BEntry entry; BEntry entry;
BDirectory dir; BDirectory dir;
@@ -237,11 +242,6 @@ ServerApp::StartAddonServer()
be_roster->Launch(&ref); be_roster->Launch(&ref);
if (err == B_OK) if (err == B_OK)
return; return;
*/
err = be_roster->Launch(B_MEDIA_ADDON_SERVER_SIGNATURE);
if (err == B_OK)
return;
(new BAlert("media_server", "Launching media_addon_server failed.\n\n" (new BAlert("media_server", "Launching media_addon_server failed.\n\n"
"media_server will terminate", "OK"))->Go(); "media_server will terminate", "OK"))->Go();