aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-07-27 10:01:17 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-07-27 10:01:17 +0000
commit1c822162c25c02121b89f0b226e38c6b1e7d207b (patch)
tree6b4a801ccebb7fe96f83406509dacb8e960f1527
parent63194435c3760ea232a3dcb75c7f843e8b1a9055 (diff)
downloadlcd4linux-1c822162c25c02121b89f0b226e38c6b1e7d207b.tar.gz
MPD plugin patch from michu
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@832 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--plugin_mpd.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/plugin_mpd.c b/plugin_mpd.c
index d101ed9..5a950c8 100644
--- a/plugin_mpd.c
+++ b/plugin_mpd.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2006 Stefan Kuhne <sk-privat@gmx.net>
* Copyright (C) 2007 Robert Buchholz <rbu@gentoo.org>
+ * Copyright (C) 2007 Michael Vogt <michu@neophob.com>
* Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
*
* This file is part of LCD4Linux.
@@ -258,7 +259,27 @@ static int mpd_get(int function)
int ret = -1;
MpdObj *mi = NULL;
- mi = mpd_new("localhost", 6600, NULL);
+ char *host = "localhost";
+ char *port = "6600";
+ int iport;
+ char *test;
+
+ if ((test = getenv("MPD_HOST"))) {
+ host = test;
+ }
+
+ if ((test = getenv("MPD_PORT"))) {
+ port = test;
+ }
+
+ iport = strtol(port, &test, 10);
+
+ if ((iport < 0) || (*test != '\0')) {
+ fprintf(stderr, "[MPD] MPD_PORT \"%s\" is not a positive integer\n", port);
+ exit(EXIT_FAILURE);
+ }
+
+ mi = mpd_new(host, iport, NULL);
mpd_signal_connect_error(mi, (ErrorCallback) error_callback, NULL);
mpd_set_connection_timeout(mi, 5);
> 2012-03-08Update to S-V 3.9.3Jonathan McCrohan2-2/+3 2012-03-08* Rewrite init script to use lsb-base functions.Jonathan McCrohan3-15/+16 - init.d-script-does-not-implement-optional-option 2012-03-08copyright-refers-to-symlink-licenseJonathan McCrohan2-2/+3 2012-03-08* Lintian fixesJonathan McCrohan2-4/+7 - spelling-error-in-manpage 2012-03-08Import upstream version 0.11.0~svn1180Jonathan McCrohan19-2871/+3952 2011-12-27Import upstream version 0.11.0~svn1165Jonathan McCrohan6-166/+495 2011-12-25Import upstream version 0.11.0~svn1164Jonathan McCrohan11-162/+315 2011-12-25Update libmysqlclient-dev virtual package in build-depends.Jonathan McCrohan1-1/+1 Thanks to Clint Byrum <clint@ubuntu.com> for the patch. 2011-08-31Import upstream version 0.11.0~svn1159Jonathan McCrohan4-5/+5 2011-08-30update debian/changelogReinhard Tartler1-1/+4 2011-08-28* New upstream snapshotJonathan McCrohan2-4/+11 * Make lcd4linux linux specific (requested by kFreeBSD team) * Add optional build targets build-indep and build-dep (thanks to lintian for catching this) 2011-08-26Import upstream version 0.11.0~svn1158Reinhard Tartler34-1743/+4490 2011-08-20normalize with wrap-and-sort(1)Reinhard Tartler2-17/+20 2011-08-20Make lcd4linux linux specificReinhard Tartler1-2/+1 on request of freebsd porters: http://permalink.gmane.org/gmane.linux.debian.devel.general/164670 2011-04-29add sqlite3-dev to build dependssiretart@tauware.de2-2/+4 2011-04-29mention new co-maintainersiretart@tauware.de1-0/+1 2011-04-29add libdbus-1-dev to build dependssiretart@tauware.de2-1/+3 2011-04-29normalize fields with wrap-and-sort(1)siretart@tauware.de2-18/+20 2011-04-29fix order of calling dh_autoreconf_cleansiretart@tauware.de1-1/+1 avoids leftover debhelper log file 2011-04-29Add Uploader details to Debian PackageJonathan McCrohan1-0/+1 2011-04-27Bug fix: "script lcd4linux/init.d/lcd4linux missing dependency onReinhard Tartler2-1/+5 $syslog", thanks to Petter Reinholdtsen (Closes: #582825). 2011-04-27No longer build the mpd module. Closes: #578226Reinhard Tartler1-0/+1 2011-04-27No longer compile against Python. Python 2.6 now links against libssl,Reinhard Tartler2-2/+3 which is in conflicts with the package license GPL.