X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/2a10b70b1cdbd55e9f2c26ed52dcff5255cd6e96..ab560bd251dd03942fe5ea3111556c1246438d33:/server/server.c diff --git a/server/server.c b/server/server.c index c5fb010..80afbe5 100644 --- a/server/server.c +++ b/server/server.c @@ -42,6 +42,7 @@ #include "server.h" #include "syscalls.h" #include "queue.h" +#include "server-queue.h" #include "play.h" #include "log.h" #include "mem.h" @@ -777,8 +778,8 @@ static int c_log(struct conn *c, static void post_move_cleanup(void) { struct queue_entry *q; - /* If we have caused the random track to not be at the end then we make it no - * longer be random. */ + /* If we have caused any random tracks to not be at the end then we make them + * no longer be random. */ for(q = qhead.next; q != &qhead; q = q->next) if(q->state == playing_random && q->next != &qhead) q->state = playing_unplayed; @@ -930,6 +931,18 @@ static int c_new(struct conn *c, } +static int c_rtp_address(struct conn *c, + char attribute((unused)) **vec, + int attribute((unused)) nvec) { + if(config->speaker_backend == BACKEND_NETWORK) { + sink_printf(ev_writer_sink(c->w), "252 %s %s\n", + quoteutf8(config->broadcast.s[0]), + quoteutf8(config->broadcast.s[1])); + } else + sink_writes(ev_writer_sink(c->w), "550 No RTP\n"); + return 1; +} + #define C_AUTH 0001 /* must be authenticated */ #define C_TRUSTED 0002 /* must be trusted user */ @@ -970,6 +983,7 @@ static const struct command { { "rescan", 0, 0, c_rescan, C_AUTH|C_TRUSTED }, { "resolve", 1, 1, c_resolve, C_AUTH }, { "resume", 0, 0, c_resume, C_AUTH }, + { "rtp-address", 0, 0, c_rtp_address, C_AUTH }, { "scratch", 0, 1, c_scratch, C_AUTH }, { "search", 1, 1, c_search, C_AUTH }, { "set", 3, 3, c_set, C_AUTH, },