OSDN Git Service

Mention mpd log size
authorwifiextender <router@archlinux.info>
Fri, 22 Jul 2016 23:07:22 +0000 (01:07 +0200)
committerwifiextender <router@archlinux.info>
Fri, 22 Jul 2016 23:07:22 +0000 (01:07 +0200)
README.md
src/functions.c

index 8e3c7e8..5603937 100644 (file)
--- a/README.md
+++ b/README.md
@@ -106,6 +106,39 @@ To see the currently played song name:
 * libmpdclient
 * mpd (with properly configured config)
 
+Here's an example of my **/etc/mpd.conf**
+
+```nginx
+music_directory "/home/frost/music"
+playlist_directory "/home/frost/music"
+db_file "/tmp/mpddb"
+log_file "/tmp/mpdlog"
+state_file "/tmp/mpdstate"
+pid_file "/tmp/mpdpid"
+user "mpd"
+log_level "default"
+
+
+audio_output {
+  type "alsa"
+  name "My sound card"
+  mixer_type "software"
+}
+
+audio_output {
+  type "httpd"
+  name "HTTP Stream"
+  encoder "vorbis"
+  port "8000"
+  bitrate "128"
+  format "44100:16:1"
+}
+
+bind_to_address "127.0.0.1"
+```
+
+Keep an eye on the **log file size** if you are using raspberry pi (or equivalent device) that streams the music, make sure that it's deleted automatically if it exceeds some pre-defined size.
+
 
 ## WM specific requirements
 
index 037946b..7471769 100644 (file)
@@ -416,7 +416,7 @@ get_song(char *str1) {
     return;
   }
   if (!(mpd_send_command(conn, "currentsong", NULL)) ||
-      mpd_connection_get_error(conn)) {
+      0 != (mpd_connection_get_error(conn))) {
     goto error;
   }
   if (NULL == (song = mpd_recv_song(conn))) {
@@ -430,6 +430,7 @@ get_song(char *str1) {
 error:
   if (NULL != conn) {
     mpd_connection_free(conn);
+    conn = NULL;
   }
   return;
 }