a/src/main.cxx b/src/main.cxx
...
...
38
#include "libupnpp/upnpplib.hxx"
38
#include "libupnpp/upnpplib.hxx"
39
#include "execmd.h"
39
#include "execmd.h"
40
#include "conftree.h"
40
#include "conftree.h"
41
#include "mpdcli.hxx"
41
#include "mpdcli.hxx"
42
#include "upmpd.hxx"
42
#include "upmpd.hxx"
43
#include "mediaserver.hxx"
43
#include "httpfs.hxx"
44
#include "httpfs.hxx"
44
#include "upmpdutils.hxx"
45
#include "upmpdutils.hxx"
45
#include "pathut.h"
46
#include "pathut.h"
46
47
47
using namespace std;
48
using namespace std;
...
...
545
    string UUID = LibUPnP::makeDevUUID(friendlyname, hwaddr);
546
    string UUID = LibUPnP::makeDevUUID(friendlyname, hwaddr);
546
547
547
    // Initialize the data we serve through HTTP (device and service
548
    // Initialize the data we serve through HTTP (device and service
548
    // descriptions, icons, presentation page, etc.)
549
    // descriptions, icons, presentation page, etc.)
549
    unordered_map<string, VDirContent> files;
550
    unordered_map<string, VDirContent> files;
551
    bool enableMediaServer = true;
550
    if (!initHttpFs(files, g_datadir, UUID, friendlyname, enableAV, enableOH,
552
    if (!initHttpFs(files, g_datadir, UUID, friendlyname, enableAV, enableOH,
551
                    !senderpath.empty(), enableL16,
553
                    !senderpath.empty(), enableL16, enableMediaServer,
552
                    iconpath, presentationhtml)) {
554
                    iconpath, presentationhtml)) {
553
        exit(1);
555
        exit(1);
554
    }
556
    }
555
557
556
    if (ownqueue)
558
    if (ownqueue)
...
...
569
        opts.sendermpdport = sendermpdport;
571
        opts.sendermpdport = sendermpdport;
570
    }
572
    }
571
573
572
    if (!enableAV)
574
    if (!enableAV)
573
        opts.options |= UpMpd::upmpdNoAV;
575
        opts.options |= UpMpd::upmpdNoAV;
576
574
    // Initialize the UPnP device object.
577
    // Initialize the UPnP root device object. 
575
    UpMpd device(string("uuid:") + UUID, friendlyname, ohProductDesc,
578
    UpMpd device(string("uuid:") + UUID, friendlyname, ohProductDesc,
576
                 files, mpdclip, opts);
579
                 files, mpdclip, opts);
577
    dev = &device;
580
    dev = &device;
578
581
582
    MediaServer *devmedia = nullptr;
583
    if (enableMediaServer) {
584
  // Create the Media Server embedded device object. There needs
585
  // be no reference to the root object because there can be
586
  // only one (libupnp restriction)
587
  devmedia = new MediaServer(string("uuid:") + uuidMediaServer(UUID),
588
                 friendlyNameMediaServer(friendlyname));
589
    }
590
    UPMPD_UNUSED(devmedia);
591
    
579
    // And forever generate state change events.
592
    // And forever generate state change events.
580
    LOGDEB("Entering event loop" << endl);
593
    LOGDEB("Entering event loop" << endl);
581
    setupsigs();
594
    setupsigs();
582
    device.eventloop();
595
    device.eventloop();
583
    LOGDEB("Event loop returned" << endl);
596
    LOGDEB("Event loop returned" << endl);