X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=playlist_selector.c;h=632e2a2a972c6aa386ff0a67417f554a62354bac;hb=f13b443e370c96812ab542372f2d956b1bbb2596;hp=2b0599cb0dd9f05d6bb8ee747277956e87ddcee0;hpb=c85690666e2ed2327e751b819970658d58479bfb;p=paraslash.git diff --git a/playlist_selector.c b/playlist_selector.c index 2b0599cb..632e2a2a 100644 --- a/playlist_selector.c +++ b/playlist_selector.c @@ -1,25 +1,13 @@ /* * Copyright (C) 2006-2007 Andre Noll * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file playlist_selector.c The playlist audio file selector of paraslash */ #include "server.h" -#include "afs.h" +#include "afs_common.h" #include "error.h" #include "net.h" #include "string.h" @@ -154,7 +142,7 @@ int com_ppl(int fd, __a_unused int argc, __a_unused char *argv[]) unsigned i; PARA_DEBUG_LOG("sending playlist to client (%d entries)\n", playlist_len); - for (i = 0; i < playlist_len; i++) { + for (i = 1; i <= playlist_len; i++) { int ret = send_va_buffer(fd, "%s\n", playlist[ (i + current_playlist_entry) % playlist_len]); if (ret < 0) @@ -229,6 +217,7 @@ static void pls_post_select(__a_unused fd_set *rfds, __a_unused fd_set *wfds) PARA_NOTICE_LOG("new playlist (%d entries)\n", playlist_len); sprintf(mmd->selector_info, "dbinfo1:new playlist: %d files\n" "dbinfo2:\ndbinfo3:\n", playlist_len); + current_playlist_entry = playlist_len - 1; pcd->retval = 1; pcd->size = 0; mutex_unlock(pcd->mutex);