server: Fix --autoplay-delay.
[paraslash.git] / play.c
diff --git a/play.c b/play.c
index 6e6b91f93865dd3623592098c339a181be2dbb6d..59a4cec85ce26bb5d5d57c7926ad70245a4c656b 100644 (file)
--- a/play.c
+++ b/play.c
@@ -277,7 +277,8 @@ static int eof_cleanup(struct play_task *pt)
        memset(&pt->wn, 0, sizeof(struct writer_node));
 
        task_reap(&pt->fn.task);
-       decoder->close(&pt->fn);
+       if (decoder->close)
+               decoder->close(&pt->fn);
        btr_remove_node(&pt->fn.btrn);
        free(pt->fn.conf);
        memset(&pt->fn, 0, sizeof(struct filter_node));
@@ -619,15 +620,8 @@ static char **get_mapped_keyseqs(void)
 
        result = para_malloc((NUM_MAPPED_KEYS + 1) * sizeof(char *));
        FOR_EACH_MAPPED_KEY(i) {
-               int idx = get_key_map_idx(i);
                char *seq = get_key_map_seq(i);
-               char *cmd = get_key_map_cmd(i);
-               bool internal = is_internal_key(i);
-               PARA_DEBUG_LOG("%s key sequence #%d: %s -> %s\n",
-                       internal? "internal" : "user-defined",
-                       idx, seq, cmd);
                result[i] = seq;
-               free(cmd);
        }
        result[i] = NULL;
        return result;
@@ -921,6 +915,8 @@ static int com_jmp(struct play_task *pt, int argc, char **argv)
                return ret;
        if (percent < 0 || percent > 100)
                return -ERRNO_TO_PARA_ERROR(EINVAL);
+       if (percent == 100)
+               return com_next(pt, 1, (char *[]){"next", NULL});
        if (pt->playing && !pt->fn.btrn)
                return 0;
        pt->start_chunk = percent * pt->num_chunks / 100;