X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.c;h=a16252cdf037e50bdd415b8978968b638b508f0c;hp=c5e2c93ee51363a69f3178b77c4d79982b427f73;hb=19d0ffee2c551fb8d17f01f5bd04b0c52987147b;hpb=ca14953f8f1c5968578735af5de7e966e9b4487d diff --git a/afs.c b/afs.c index c5e2c93e..a16252cd 100644 --- a/afs.c +++ b/afs.c @@ -455,7 +455,7 @@ static int pass_afd(int fd, char *buf, size_t size) } /** - * Open the audio file with highest score. + * Pass the fd of the next audio file to the server process. * * This stores all information for streaming the "best" audio file in a shared * memory area. The id of that area and an open file descriptor for the next @@ -467,27 +467,15 @@ static int pass_afd(int fd, char *buf, size_t size) */ static int open_next_audio_file(void) { - struct osl_row *aft_row; struct audio_file_data afd; int ret, shmid; char buf[8]; - long score; -again: - PARA_NOTICE_LOG("getting next audio file\n"); - ret = score_get_best(&aft_row, &score); + + ret = open_and_update_audio_file(&afd); if (ret < 0) { PARA_ERROR_LOG("%s\n", para_strerror(-ret)); goto no_admissible_files; } - ret = open_and_update_audio_file(aft_row, score, &afd); - if (ret < 0) { - ret = score_delete(aft_row); - if (ret < 0) { - PARA_ERROR_LOG("%s\n", para_strerror(-ret)); - goto no_admissible_files; - } - goto again; - } shmid = ret; if (!write_ok(server_socket)) { ret = -E_AFS_SOCKET;