a/src/main.cxx b/src/main.cxx
...
...
242
242
243
    UpMpd::Options opts;
243
    UpMpd::Options opts;
244
244
245
    string cachedir;
245
    string cachedir;
246
    string onstart;
246
    string onstart;
247
    string onplay;
247
    string onstop;
248
    string onstop;
248
    string onvolumechange;
249
    string onvolumechange;
249
    if (!g_configfilename.empty()) {
250
    if (!g_configfilename.empty()) {
250
        g_config = new ConfSimple(g_configfilename.c_str(), 1, true);
251
        g_config = new ConfSimple(g_configfilename.c_str(), 1, true);
251
        if (!g_config || !g_config->ok()) {
252
        if (!g_config || !g_config->ok()) {
...
...
280
        }
281
        }
281
        g_config->get("iconpath", iconpath);
282
        g_config->get("iconpath", iconpath);
282
        g_config->get("presentationhtml", presentationhtml);
283
        g_config->get("presentationhtml", presentationhtml);
283
        g_config->get("cachedir", cachedir);
284
        g_config->get("cachedir", cachedir);
284
        g_config->get("onstart", onstart);
285
        g_config->get("onstart", onstart);
286
        g_config->get("onplay", onplay);
285
        g_config->get("onstop", onstop);
287
        g_config->get("onstop", onstop);
286
        g_config->get("onvolumechange", onvolumechange);
288
        g_config->get("onvolumechange", onvolumechange);
287
        if (!(op_flags & OPT_i)) {
289
        if (!(op_flags & OPT_i)) {
288
            g_config->get("upnpiface", iface);
290
            g_config->get("upnpiface", iface);
289
            if (iface.empty()) {
291
            if (iface.empty()) {
...
...
463
465
464
    // Initialize MPD client object. Retry until it works or power fail.
466
    // Initialize MPD client object. Retry until it works or power fail.
465
    MPDCli *mpdclip = 0;
467
    MPDCli *mpdclip = 0;
466
    int mpdretrysecs = 2;
468
    int mpdretrysecs = 2;
467
    for (;;) {
469
    for (;;) {
468
        mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword, onstart, onstop,
470
        mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword, onstart, onplay,
469
                             onvolumechange);
471
                             onstop, onvolumechange);
470
        if (mpdclip == 0) {
472
        if (mpdclip == 0) {
471
            LOGFAT("Can't allocate MPD client object" << endl);
473
            LOGFAT("Can't allocate MPD client object" << endl);
472
            return 1;
474
            return 1;
473
        }
475
        }
474
        if (!mpdclip->ok()) {
476
        if (!mpdclip->ok()) {