Added attributes start_ms, end_ms. This allows us to address a
portion of a song file (important for CUE support). There is no
support yet for storing these attributes in the state file.
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.
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.
The decoder_plugin struct is used by both the MPD core and the decoder
plugin implementations. Move it to a shared header file, to minimize
header dependencies.
If a song is not within the music directory ("file:///..."), it has no
"parent directory". The archive code nonetheless dereferences the
parent pointer, causing a segmentation fault. Check parent!=NULL.
Some plugins used the APE or ID3 tag loader as a fallback when their
own methods of loading tags did not work. Move this code out of all
decoder plugins, into song_file_update().
Determine the suffix manually, and use decoder_plugin_from_suffix()
and archive_plugin_from_suffix() instead.
This way, song_file_update_inarchive() can be optimized: it does not
have to translate its path.
The mapper library maps directory and song objects to file system
paths. With this central library, the code mixture in path.c should
be cleaned up, and we will be able to add neat features like aliasing.
isMusic() used to be a very inefficient function: with every
invocation, it did another stat() on the specified file. There is
only one caller, do the stat() there manually and use hasMusicSuffix()
instead of isMusic().
Instead of returning 0 or -1, return true on success and false on
failure. This seems more natural, and when the C library was
designed, there was no "bool" data type.
Provide separate constructors for creating a remote song, a local
song, and one for loading data from a song file. This way, we can add
more assertions.
This makes the update code thread-safe and doesn't penalize
the playlist code by complicating it with complicated and
error-prone locks (and the associated overhead, not everybody
has a thread-implementation as good as NPTL).
The update task blocks during the delete; but the update task is
a slow task anyways so we can block w/o people caring too much.
This was also our only freeSong call site, so remove that
function.
Note that deleting entire directories is not fully thread-safe,
yet; as their traversals are not yet locked.
We already know if a song is a URL or not based on whether it
has parentDir defined or not. Hopefully one day in the future
we can drop HTTP support from MPD entirely when an HTTP
filesystem comes along and we can access streams via open(2).
The "packed" attribute may have negative side effects on performance.
Remove the "packed" attribute, and increase the size of "song.url" to
a multiple of the machine word size.