Ticket #11922: 0006-Make-launch_media_server-to-handle-the-case-when-the.patch

File 0006-Make-launch_media_server-to-handle-the-case-when-the.patch, 1.4 KB (added by Barrett, 5 years ago)
  • src/kits/media/MediaDefs.cpp

    From 58d1827f36965d115338c8d2321868920ae1d30d Mon Sep 17 00:00:00 2001
    From: Dario Casalinuovo <b.vitruvio@gmail.com>
    Date: Sat, 28 Mar 2015 16:12:34 +0100
    Subject: [PATCH 06/13] Make launch_media_server() to handle the case when the
     media_server is running but the media_addon_server is not.
    
    ---
     src/kits/media/MediaDefs.cpp | 14 ++++++++++----
     1 file changed, 10 insertions(+), 4 deletions(-)
    
    diff --git a/src/kits/media/MediaDefs.cpp b/src/kits/media/MediaDefs.cpp
    index a60facb..4298a2a 100644
    a b  
    1313
    1414#include <MediaDefs.h>
    1515#include <MediaNode.h>
     16#include <MediaRoster.h>
    1617#include <Roster.h>
    1718
    1819#include "debug.h"
    shutdown_media_server(bigtime_t timeout,  
    12871288status_t
    12881289launch_media_server(uint32 flags)
    12891290{
    1290     status_t err;
    1291 
    1292     if (be_roster->IsRunning(B_MEDIA_SERVER_SIGNATURE))
     1291    if (BMediaRoster::IsRunning())
    12931292        return B_ALREADY_RUNNING;
    12941293
     1294    // The media_server crashed
    12951295    if (be_roster->IsRunning(B_MEDIA_ADDON_SERVER_SIGNATURE)) {
    12961296        kill_team(be_roster->TeamFor(B_MEDIA_ADDON_SERVER_SIGNATURE));
    12971297        snooze(1000000);
    12981298    }
    12991299
    1300     err = be_roster->Launch(B_MEDIA_SERVER_SIGNATURE);
     1300    // The media_addon_server crashed
     1301    if (be_roster->IsRunning(B_MEDIA_SERVER_SIGNATURE)) {
     1302        kill_team(be_roster->TeamFor(B_MEDIA_SERVER_SIGNATURE));
     1303        snooze(1000000);
     1304    }
     1305
     1306    status_t err = be_roster->Launch(B_MEDIA_SERVER_SIGNATURE);
    13011307    if (err != B_OK)
    13021308        return err;
    13031309