| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Again, a data type which can be forward-declared.
[ew:
* used "struct mpd_song" instead to avoid token duplication
(like I did with "struct mpd_tag") as there's no good
abbreviation for "song" and identical tokens on the same
line don't read well
* rewritten using
perl -i -p -e 's/\bSong\b/struct mpd_song/g' src/*.[ch]
since it was too hard to merge
* also, I don't care much for forward declarations
]
|
|
|
|
| |
Thanks (again) to unK for the report :x
|
|
|
|
|
|
|
| |
This actually opened us up to making lock dependencies more
difficult than they needed to be now that we have threaded
updates. We would always use the memory anyways, just in
the stack instead of bss.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the
mind needs to retrain itself to skip over the first 4 tokens of
a type to get to its meaning. So avoid having extra characters
on my terminal to make it easier to follow code at 2:30 am in
the morning.
Please report any new issues you may come across on Free
toolchains. I realize how difficult it can be to build/maintain
cross-compiling toolchains and I have no intention of forcing
people to upgrade their toolchains to build mpd.
Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
|
|
|
|
| |
We don't change the song pointer there, either.
|
|
|
|
|
|
|
|
|
| |
I have serious trust issues when using stdio to write to the FS.
So it's best to clean this code out so I can start figuring out
what's wrong with Rasi's box not updating...
None of these writes take place in a performance-critical
setting anyways...
|
|
|
|
|
| |
Return an "enum playlist_result" value instead of calling
commandError() in storedPlaylist.c.
|
|
|
|
|
|
| |
The playlist library shouldn't talk to the client if possible.
Introduce the "enum playlist_result" type which the caller
(i.e. command.c) may use to generate an error message.
|
|
|
|
| |
Make them both return void.
|
|
|
|
|
|
|
|
| |
Client's input values should be validated by the command
implementation, and the core libraries shouldn't talk to the client
directly if possible. Thus, setPlaylistRepeatStatus() and
setPlaylistRandomStatus() don't get the file descriptor, and cannot
fail (return void).
|
|
|
|
|
|
|
|
| |
The function valid_playlist_name() checks the name, but it insists on
reporting an eventual error to the client. The new function
is_valid_playlist_name() is more generic: it just returns a boolean,
and does not care what the caller will use it for. The old function
valid_playlist_name() will be removed later.
|
|
|
|
| |
The usual bunch of const pointer conversions.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* mk/tag: (22 commits)
tag: fix segfault on update
utf8.h: Fix build (broken os_compat.h #include)
tag: optimize tag_dup(), copy item references
tag: fix the shout and oggflac plugins
const pointers
tag: static directory name
tag: try not to reallocate tag.items in every add() call
song: don't export newNullSong()
tag: try not to duplicate the input string
tag: pass length to fix_utf8()
added "length" parameter to validUtf8String()
assert value!=NULL in fix_utf8()
tag: converted macro fixUtf8() to an inline function
tag: added a pool for tag items
tag: converted tag_item.value to a char array
removed tree.c
tag: converted MpdTag.items to a pointer list
tag: moved code to tag_id3.c
wavpack: tag_new() cannot fail
tag: converted tag_add_item() to an inline function
...
|
|/ |
|
|
|
|
| |
Only include headers which are really needed.
|
|
|
|
|
| |
Again, remove file descriptor parameters, which are not actually
used. These functions can also be converted to return void.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a huge refactoring of the core mpd process. The
queueing/buffering mechanism is heavily reworked.
The player.c code has been merged into outputBuffer (the actual
ring buffering logic is handled by ringbuf.c); and decode.c
actually handles decoding stuff.
The end result is several hundreds of lines shorter, even though
we still have a lot of DEBUG statements left in there for
tracing and a lot of assertions, too.
|
|
|
|
|
|
|
|
|
| |
Try to only include headers which are really needed. We should
particularly check all "headers including other headers". The
long-term goal is to have a manageable, small API for plugins
(decoders, output) without so many mpd internals cluttering the
namespace.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@7300 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's too ugly and broken (both technically and usability-wise)
to be worth supporting in any stable release.
In one sentence: The queue is a very crippled version of the
playlist that takes precedence over the normal playlist.
How is it crippled?
* The "queueid" command only allows the queuing of songs
ALREADY IN THE PLAYLIST! This promotes having the entire mpd
database of songs in the playlist, which is a stupid practice
to begin with.
* It doesn't allow for meaningful rearranging and movement
of songs within the queue. To move a song, you'd need to
dequeue and requeue it (and other songs on the list).
Why? The playlist already allows _all_ these features
and shows everything a client needs to know about the ordering
of songs in a _single_ command!
* Random was a stupid idea to begin with and unfortunately
we're stuck supporting it since we've always had it. Users
should learn to use "shuffle" instead and not look at their
playlists. Implementing queue because we have the problem of
random is just a bandage fix and digging ourselves a new hole.
This protocol addition was never in a stable release of mpd, so
reverting it will only break things for people following trunk;
which I'm not too worried about. I am however worried about
long-term support of this misfeature, so I'm removing it.
Additionally, there are other points:
* It's trivially DoS-able:
(while true; do echo queueid $song_id; done) | nc $MPD_HOST $MPD_PORT
The above commands would cause the queue to become infinitely
expanding, taking up all available memory in the system. The
mpd playlist was implemented as an array with a fixed (but
configurable) size limit for this reason.
* It's not backwards-compatible. All clients would require
upgrades (and additional complexity) to even know what the
next song in the playlist is. mpd is a shared architecture,
and we should not violate the principle of least astonishment
here.
This removes the following commands:
queueid, dequeue, queueinfo
Additionally, the status field of "playlistqueue: " is removed
from the status command.
While this DoS is trivial to fix, the design is simply too
broken to ever support in a real release.
The overloading of the "addid" command and the allowing of
negative numbers to be used as offsets is far more flexible.
This improved "addid" is completely backwards-compatible with
all clients, and does not require clients to have UI changes or
run additional commands to display the queue.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7155 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While mpd has always protected against the infinite expansion of
the main playlist by limiting its size in memory, however the
new storedPlaylist code has never checked for this limit.
Malicious (or clumsy) users could repeatedly append songs to
stored playlists, causing files to grow increasingly large
on disk. Attempting to load extremely large files into memory
will require mpd to slurp that all into memory, and ultimately
the file would be unusable by mpd because of the configurable
playlist size limit.
Now we limit stored playlists to the max_playlist_length
configuration variable set by the user (default is 16384). We
will refuse to append to playlist files if they hit that limit;
and also refuse to load more than the specified amount of songs
into memory.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7154 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of printing out the Id from playlist.c, instead set
the integer that added_id poitns to if added_id is non-NULL.
This makes the API cleaner and will allow us to use additional
commands to manipulate the newly-added song_id. Callers
(handleAddId) that relied on printId to print it to the given
fd have now been modified to print the ID at a higher-level;
making playlist.c less-dependent on protocol details.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7149 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will make refactoring features easier, especially now that
pthreads support and larger refactorings are on the horizon.
Hopefully, this will make porting to other platforms (even
non-UNIX-like ones for masochists) easier, too.
os_compat.h will house all the #includes for system headers
considered to be the "core" of MPD. Headers for optional
features will be left to individual source files.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
| |
It was a nice way to double the memory needed to write the
playlist to a file.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7116 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the following commands:
* queueid <id> Add song <id> to the queue.
* dequeue <pos> Remove song from <pos> from the queue
* queueinfo List the queue
To the statusfield it adds the following entry:
playlistqueue: <uid> UID can be used by clients to track changes in the playlist queue.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6927 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
new commands: playlistmove and playlistdelete.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6116 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
playlist.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5420 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
use of these functions are still being worked on.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5075 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
| |
Add -Wmissing-prototypes if compiling with gcc
Static where possible
git-svn-id: https://svn.musicpd.org/mpd/trunk@4657 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
This way it's easier to manage and extend.
git-svn-id: https://svn.musicpd.org/mpd/trunk@4494 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch massively reduces the amount of heap allocations at
the interface/command layer. Most commands with minimal output
should not allocate memory from the heap at all. Things like
repeatedly polling status, currentsong, and volume changes
should be faster as a result, and more importantly, not a source
of memory fragmentation.
These changes should be safe in that there's no way for a
remote-client to corrupt memory or otherwise do bad stuff to
MPD, but an extra set of eyes to review would be good. Of
course there's never any warranty :)
No longer do we use FILE * structures in the interface, which means
we don't have to allocate any new memory for most connections.
Now, before you go on about losing the buffering that FILE *
+implies+, remember that myfprintf() never took advantage of
any of the stdio buffering features.
To reduce the diff and make bugs easier to spot in the diff,
I've kept myfprintf in places where we write to files (and not
network interfaces). Expect myfprintf to go away entirely soon
(we'll use fprintf for writing regular files).
git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
| |
Indent the entire tree, hopefully we can keep
it indented.
git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
static where it makes sense
git-svn-id: https://svn.musicpd.org/mpd/trunk@4344 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
the GPL header where necessary
git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@4136 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
plchanges command, it only sends the pos and id of the changed command. Libmpd allready has support for it, and libmpdclient in libmpd too
git-svn-id: https://svn.musicpd.org/mpd/trunk@4101 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
adds listPlaylist and listPlaylistInfo
git-svn-id: https://svn.musicpd.org/mpd/trunk@3947 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@2500 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
returns the songid of the added song. Note that "addid" does not work on directories
git-svn-id: https://svn.musicpd.org/mpd/trunk@2487 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
| |
swapid
git-svn-id: https://svn.musicpd.org/mpd/trunk@1408 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@1339 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@271 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@242 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@240 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
git-svn-id: https://svn.musicpd.org/mpd/trunk@1 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|