From: Andre Noll Date: Mon, 22 Oct 2007 20:30:05 +0000 (+0200) Subject: vss.c: Remove some unused code. X-Git-Tag: v0.3.0~271 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=e6f65525fb59ceec8407020dc882118968294cb3;p=paraslash.git vss.c: Remove some unused code. --- diff --git a/vss.c b/vss.c index dbf8547c..82dff47e 100644 --- a/vss.c +++ b/vss.c @@ -204,11 +204,6 @@ void vss_init(void) } } -static int get_file_info(int i) -{ - return afl[i].get_file_info(map, mmd->size, &mmd->afi); -} - /** * guess the audio format judging from filename * @@ -239,19 +234,6 @@ int guess_audio_format(const char *name) return -E_BAD_AUDIO_FILE_SUFFIX; } -static int get_audio_format(int omit) -{ - int i; - - FOR_EACH_AUDIO_FORMAT(i) { - if (i == omit) - continue; - if (get_file_info(i) > 0) - return i; - } - return -E_AUDIO_FORMAT; -} - /** * Call get_file_info() to obtain an afhi structure. * @@ -291,79 +273,6 @@ int compute_afhi(const char *path, char *data, size_t size, return -E_AUDIO_FORMAT; } -/* - * upddate shared mem - */ -static int update_mmd(void) -{ - int i; - - i = guess_audio_format(mmd->filename); - if (i < 0 || get_file_info(i) < 0) - i = get_audio_format(i); - if (i < 0) - return i; - mmd->audio_format = i; - mmd->chunks_sent = 0; - mmd->current_chunk = 0; - mmd->offset = 0; - mmd->events++; - return 1; -} - -static void vss_get_audio_file(void) -{ - char **sl = selectors[mmd->selector_num].get_audio_file_list(10); - int i; - struct stat file_status; - - if (!sl) - goto err_out; - for (i = 0; sl[i]; i++) { - struct timeval now; - PARA_INFO_LOG("trying %s\n", sl[i]); - if (strlen(sl[i]) >= _POSIX_PATH_MAX) - continue; - audio_file = open(sl[i], O_RDONLY); - if (audio_file < 0) - continue; - if (fstat(audio_file, &file_status) == -1 || - !file_status.st_size) { - close(audio_file); - continue; - } - mmd->size = file_status.st_size; - mmd->mtime = file_status.st_mtime; - map = para_mmap(mmd->size, PROT_READ, MAP_PRIVATE, - audio_file, 0); - strcpy(mmd->filename, sl[i]); - mmd->afi.header_len = 0; /* default: no header */ - if (update_mmd() < 0) { /* invalid file */ - close(audio_file); - munmap(map, mmd->size); - map = NULL; - continue; - } - mmd->num_played++; - if (selectors[mmd->selector_num].update_audio_file) - selectors[mmd->selector_num].update_audio_file(sl[i]); - PARA_NOTICE_LOG("next audio file: %s\n", mmd->filename); - mmd->new_vss_status_flags &= (~VSS_NEXT); - gettimeofday(&now, NULL); - tv_add(&now, &announce_tv, &data_send_barrier); - goto free; - } -err_out: - PARA_ERROR_LOG("%s", "no valid files found\n"); - mmd->new_vss_status_flags = VSS_NEXT; -free: - if (sl) { - for (i = 0; sl[i]; i++) - free(sl[i]); - free(sl); - } -} - static int chk_barrier(const char *bname, const struct timeval *now, const struct timeval *barrier, struct timeval *diff, int print_log)