diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-29 13:17:42 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-29 13:17:42 +0200 |
commit | a0364d38d3542534600496c189a19b7482ef962c (patch) | |
tree | 5d9006dc8e7c10e34cbdc4b4d2a27194a8a449b0 /src/directory.c | |
parent | 9819890f1dfe1bcb128f9857efd26f37b1a601ee (diff) | |
download | mpd-a0364d38d3542534600496c189a19b7482ef962c.tar.gz mpd-a0364d38d3542534600496c189a19b7482ef962c.tar.xz mpd-a0364d38d3542534600496c189a19b7482ef962c.zip |
directory: remove "Mp3" references
MPD has supported more audio formats than just MP3
for over five years...
Diffstat (limited to 'src/directory.c')
-rw-r--r-- | src/directory.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/directory.c b/src/directory.c index 60bcf8ff8..2842ffa78 100644 --- a/src/directory.c +++ b/src/directory.c @@ -53,7 +53,7 @@ enum update_progress { UPDATE_PROGRESS_DONE = 2 } progress; -static Directory *mp3rootDirectory; +static Directory *music_root; static time_t directory_dbModTime; @@ -138,7 +138,7 @@ static void * update_task(void *arg) } freeList(path_list); } else { - ret = updateDirectory(mp3rootDirectory); + ret = updateDirectory(music_root); } if (ret == UPDATE_RETURN_UPDATED && writeDirectoryDB() < 0) @@ -315,7 +315,7 @@ static Directory *addDirectoryPathToDB(const char *utf8path) parent = parent_path(path_max_tmp, utf8path); if (strlen(parent) == 0) - parentDirectory = (void *)mp3rootDirectory; + parentDirectory = music_root; else parentDirectory = addDirectoryPathToDB(parent); @@ -351,7 +351,7 @@ static Directory *addParentPathToDB(const char *utf8path) parent = parent_path(path_max_tmp, utf8path); if (strlen(parent) == 0) - parentDirectory = (void *)mp3rootDirectory; + parentDirectory = music_root; else parentDirectory = addDirectoryPathToDB(parent); @@ -386,7 +386,7 @@ static enum update_return updatePath(const char *utf8path) return ret; } /* we don't want to delete the root directory */ - else if (directory == mp3rootDirectory) { + else if (directory == music_root) { free(path); return UPDATE_RETURN_NOUPDATE; } @@ -618,9 +618,9 @@ addToDirectory(Directory * directory, const char *name) return UPDATE_RETURN_ERROR; } -void closeMp3Directory(void) +void directory_finish(void) { - freeDirectory(mp3rootDirectory); + freeDirectory(music_root); } int isRootDirectory(const char *name) @@ -663,7 +663,7 @@ static Directory *getSubDirectory(Directory * directory, const char *name) static Directory *getDirectory(const char *name) { - return getSubDirectory(mp3rootDirectory, name); + return getSubDirectory(music_root, name); } static int printDirectoryList(struct client *client, struct dirvec *dv) @@ -844,11 +844,11 @@ int writeDirectoryDB(void) struct stat st; DEBUG("removing empty directories from DB\n"); - deleteEmptyDirectoriesInDirectory(mp3rootDirectory); + deleteEmptyDirectoriesInDirectory(music_root); DEBUG("sorting DB\n"); - sortDirectory(mp3rootDirectory); + sortDirectory(music_root); DEBUG("writing DB\n"); @@ -865,7 +865,7 @@ int writeDirectoryDB(void) fprintf(fp, "%s%s\n", DIRECTORY_FS_CHARSET, getFsCharset()); fprintf(fp, "%s\n", DIRECTORY_INFO_END); - writeDirectoryInfo(fp, mp3rootDirectory); + writeDirectoryInfo(fp, music_root); while (fclose(fp) && errno == EINTR); @@ -881,8 +881,8 @@ int readDirectoryDB(void) char *dbFile = getDbFile(); struct stat st; - if (!mp3rootDirectory) - mp3rootDirectory = newDirectory(NULL, NULL); + if (!music_root) + music_root = newDirectory(NULL, NULL); while (!(fp = fopen(dbFile, "r")) && errno == EINTR) ; if (fp == NULL) { ERROR("unable to open db file \"%s\": %s\n", @@ -943,7 +943,7 @@ int readDirectoryDB(void) DEBUG("reading DB\n"); - readDirectoryInfo(fp, mp3rootDirectory); + readDirectoryInfo(fp, music_root); while (fclose(fp) && errno == EINTR) ; stats.numberOfSongs = countSongsIn(NULL); @@ -1007,10 +1007,10 @@ int traverseAllIn(const char *name, data); } -void initMp3Directory(void) +void directory_init(void) { - mp3rootDirectory = newDirectory(NULL, NULL); - exploreDirectory(mp3rootDirectory); + music_root = newDirectory(NULL, NULL); + exploreDirectory(music_root); stats.numberOfSongs = countSongsIn(NULL); stats.dbPlayTime = sumSongTimesIn(NULL); } |