| Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
Reduce the number of lock/unlock cycles, and make database handling
safer.
|
|
|
|
Wrap songvec_find() and other songvec methods.
|
|
Random access is not needed, and a linked list is easier to manage: we
don't need to (re-)allocate the pointer array.
|
|
Pass only the "name" to a directory, instead of the full (relative)
path.
|
|
"stat" is a macro on mingw32, which is a pretty stupid thing, and this
commit works around this build failure.
|
|
|
|
|
|
Use this struct for db_walk().
|
|
Keep those when scanning for empty directories. The check in
playlist_vector_is_empty() was missing.
|
|
|
|
Cast the constant to dev_t, not to unsigned.
|
|
Fix gcc warning.
|
|
Don't open the music directory for each "lsinfo" call. Get the list
of playlist files from the memory database.
|
|
|
|
After we've been hit by Large File Support problems several times in
the past week (which only occur on 32 bit platforms, which I don't
have), this is yet another attempt to fix the issue.
|
|
*sigh* another Large File breakage. ino_t/dev_t this time. We need
to include config.h in directory.h to get this straight.
|
|
Moved code from db_get_song().
|
|
Renamed directory_get_directory() to directory_lookup_directory().
Added API documentation.
|
|
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
|
|
[mk: fixed whitespace errors; use delete_song() instead of
songvec_delete()]
|
|
Remember the modification time of each directory. This is important
for archives (which are virtual directories right now), but may also
be useful for an automatic update mechanism.
|
|
Moved some of them to to directory_save.c, and others to database.c.
|
|
directory_is_root() is cheaper than
isRootDirectory(directory_get_path()).
|
|
|
|
"LOG_H" is a macro which is also used by ffmpeg/log.h. This is
ffmpeg's fault, because short macros should be reserved for
applications, but since it's always a good idea to choose prefixed
macro names, even for applications, we are going to do that in MPD.
|
|
directory_get_name() returns the base name of the directory.
|
|
The inline functions directory_is_empty() and directory_get_path()
don't modify the object - pass constant object pointers to them.
|
|
This way we avoid unnecessary heap allocations.
|
|
Some tiny utilities... wrappers like these may become helpful when we
introduce locking.
|
|
No idea why it was created in directory.h, but it should be in
dirvec.h.
|
|
Remove clutter from directory.c. Everything which saves or loads
to/from the hard disk goes to directory_save.c, and code which sends
directory information to the client is moved into directory_print.c.
|
|
ino_t and dev_t are declared in sys/types.h, not sys/stat.h.
|
|
For the root directory, let's set path to an empty string. This saves
a few checks.
|
|
Also convert directory_get_path() to an inline function, which returns
a constant string.
|
|
CamelCase is ugly, rename the functions.
|
|
Taming the directory.c monster, part II: move the database management
stuff to database. directory.c should only contain code which works
on directory objects.
|
|
The function isRootDirectory() is tiny and can be converted to an
inline function. Don't allow name==NULL.
|
|
When there are standardized headers, use these instead of the bloated
os_compat.h.
|
|
Again, a data type which can be forward-declared.
|
|
The struct can be forward-declared by other headers, which relaxes the
header dependencies.
|
|
directory_is_empty() is a tiny inline function which determine if a
directory has any child objects (sub directories or songs).
|
|
The source directory.c mixes several libraries: directory object
management, database management and database update, resulting in a
1000+ line monster. Move the whole database update code to update.c.
|
|
Now the "update" command can be issued multiple times regardless
of whether the client is in list mode or not.
We serialize the update tasks to prevent updates from trampling
over each other and will spawn another update task
once the current one is finished updating and reaped.
Right now we cap the queue size to 32 which is probably enough (I
bet most people usually run update with no argument anyways);
but we can make it grow/shrink dynamically if needed. There'll
still be a hard-coded limit to prevent DoS attacks, though.
|
|
MPD has supported more audio formats than just MP3
for over five years...
|
|
We no longer fork for directory updates, so we
no longer have children to reap.
|
|
Small memory reduction compared to songvec since most users have
much fewer dirs than songs, but still nice to have.
|