]> www.infradead.org Git - users/dwmw2/mpc-car2pc.git/commitdiff
fix playlist saving when not playing
authorDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 21 May 2009 08:35:06 +0000 (09:35 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 21 May 2009 08:35:06 +0000 (09:35 +0100)
mpc-car2pc.c

index 884bc936bd2ae3a3287474982115a279ce6e5948..9b9c20609cd19c2bb5018d4b36f2a9f3070ffa73 100644 (file)
@@ -1,3 +1,26 @@
+/* 
+ *  mpc-car2pc: Interface between Music Player Dæmon and Car2PC adapter
+ *
+ *  http://www.musicpd.org/
+ *  http://www.car2pc.com/
+ *
+ *  Copyright © 2009 David Woodhouse <dwmw2@infradead.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
 #define _BSD_SOURCE
 
 #include <stdio.h>
@@ -237,15 +260,14 @@ int mainloop(void)
                if (sts->playlist != plid) {
                        save_disc();
                        track = -1;
+                       plid = sts->playlist;
                }
 
                if (sts->state == MPD_STATUS_STATE_PLAY) {
-                       if (sts->song != track ||
-                           sts->playlist != plid) {
+                       if (sts->song != track) {
                                track = sts->song;
                                send_car2pc_command("TR%03d", track + 1);
                                send_song_info();
-                               plid = sts->playlist;
                                track = sts->song;
                        }
                        if (sts->elapsedTime != last_time) {