X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=play.c;h=2346c6b0101045d51e87b5d40abb5b983df6f014;hp=c860208caff9411ac830dc976f5f5985ac9d96ea;hb=b3c68fd8519a426d6b6285dcb5a865670285e99a;hpb=25ca76ec354120efa561879f50c486340e14d0ca diff --git a/play.c b/play.c index c860208c..2346c6b0 100644 --- a/play.c +++ b/play.c @@ -219,7 +219,6 @@ static long unsigned get_play_time(void) return result; } - static void wipe_receiver_node(void) { PARA_NOTICE_LOG("cleaning up receiver node\n"); @@ -434,6 +433,15 @@ static int next_valid_file(void) int i, j = pt->current_file; unsigned num_inputs = lls_num_inputs(play_lpr); + if (j == num_inputs - 1) { + switch (OPT_UINT32_VAL(END_OF_PLAYLIST)) { + case EOP_LOOP: break; + case EOP_STOP: + pt->playing = false; + return 0; + case EOP_QUIT: return -E_EOP; + } + } for (i = 0; i < num_inputs; i++) { j = (j + 1) % num_inputs; if (!pt->invalid[j]) @@ -1238,9 +1246,6 @@ int main(int argc, char *argv[]) int ret; unsigned num_inputs; - /* needed this early to make help work */ - recv_init(); - sched.default_timeout.tv_sec = 5; parse_config_or_die(argc, argv); session_open(); @@ -1248,7 +1253,6 @@ int main(int argc, char *argv[]) init_shuffle_map(); pt->invalid = para_calloc(sizeof(*pt->invalid) * num_inputs); pt->rq = CRT_FILE_CHANGE; - pt->current_file = num_inputs - 1; pt->playing = true; pt->task = task_register(&(struct task_info){ .name = "play",