-
- PARA_NOTICE_LOG("getting next af\n");
- ret = score_get_best(&aft_row, &afd.score);
- if (ret < 0)
- return ret;
- ret = open_and_update_audio_file(aft_row, &afd);
- if (ret < 0)
- return ret;
+ long score;
+again:
+ PARA_NOTICE_LOG("getting next audio file\n");
+ ret = score_get_best(&aft_row, &score);
+ 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) {
+ PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+ ret = score_delete(aft_row);
+ if (ret < 0) {
+ PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+ goto no_admissible_files;
+ }
+ goto again;
+ }