X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.c;h=ea0a9f9f310d55f3e4fc56377a3583937e1bd92d;hp=b74cb45c715adc34a1be87c32b2a251fc5dfdd86;hb=bb073aafd9c921d59031c0677dab2b02a86647a1;hpb=0e75bc32026c5c43fa36e93e82d8b34f89342170 diff --git a/afs.c b/afs.c index b74cb45c..ea0a9f9f 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;