| Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
This fixes a deadlock bug introduced by 18076ac9. After all, the
second Cond was necessary.
The problem: two threads can wait for a signal at the same time. The
player thread waits for the output thread to finish playback. The
main thread waits for the player thread to complete a command. The
output thread finishes playback, and sends a signal, which
unfortunately does not wake up the player thread, but the main
thread. The main thread sees that the command is still not finished,
and waits again. The signal is lost forever, and MPD is deadlocked.
|
|
|
|
|
|
|
|
|
|
This commit reimplements the core of the "single" mode. Instead of
doing the detection in the playlist code from the outside, it is moved
to the player thread, which gets a new option called "border_pause".
It will now pause playback exactly at the beginning of the new song,
making the feature more reliable.
Now that the player thread knows what will happen, it can suppress
cross-fading.
Fixes mantis tickets 0003055 and 0003166.
|
|
Make sure the player "owns" the next_song object, so nobody else can
free it.
|
|
Rewrite of the pc_get_error_message() function, now using a GError
object instead of the complicated "errored_song" attribute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Allocate a player_control object where needed, and pass it around.
Each "client" object is associated with a "player_control" instance.
This prepares multi-player support.
|
|
Adds mixrampdb and mixrampdelay commands. Reads MIXRAP_START and
MIXRAMP_END tags from FLAC files and overlaps instead of crossfading.
|
|
|
|
Our use of the "volatile" keyword was wrong from the start, and now
that we have proper locking, we can safely remove all of them.
|
|
They are just informational.
|
|
Allocate a decoder_control object where needed, and pass it around.
This will allow more than one decoder thread one day.
|
|
Use GMutex/GCond instead of the notify library. Manually lock the
player_control object before accessing the protected attributes. Use
the GCond object to notify the player thread and the main thread.
|
|
With these methods, an output plugin can allocate some global
resources only if it is actually enabled. The method enable() is
called after daemonization, which allows for more sophisticated
resource allocation during that method.
|
|
Tracking the "elapsed" time from the chunks which we have sent to the
output pipe is very imprecise: since we have implemented the music
pipe, we're sending large number of chunks at once, giving the
"elapsed" time stamp a resolution of usually more than a second.
This patch changes the source of this information to the outputs. If
a chunk has been played by all outputs, the "elapsed" time stamp is
updated.
The new command PLAYER_COMMAND_REFRESH makes the player thread update
its status information: it tells the outputs to update the chunk time
stamp. After that, player_control.elapsed_time is current.
|
|
Sending PLAYER_COMMAND_STOP followed by PLAYER_COMMAND_QUEUE does the
same. PLAYER_COMMAND_PLAY is redundant.
|
|
|
|
The new player_status struct replaces a bunch of playerGetX()
functions. When we add proper locking to the player_control struct,
we will only need to lock once for the "status" command.
|
|
This lets us eliminate the static fixed-size buffer.
|
|
Do all the software volume stuff inside each output thread, not in the
player thread. This allows one software mixer per output device, and
also allows the user to configure the mixer type (hardware or
software) for each audio output.
This moves the global "mixer_type" setting into the "audio_output"
section, deprecating the "mixer_enabled" flag.
|
|
Renamed playerSeek() to pc_seek() to get rid of CamelCase. Convert
the return value to bool.
|
|
|
|
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.
|
|
Turn the music_pipe into a simple music_chunk queue. The music_chunk
allocation code is moved to music_buffer, and is now managed with a
linked list instead of a ring buffer. Two separate music_pipe objects
are used by the decoder for the "current" and the "next" song, which
greatly simplifies the cross-fading code.
|
|
player_control.thread contains the handle of the player thread, or
NULL if the player thread isn't running.
|
|
Older gcc versions complained about shadowed parameters in prototypes.
|
|
When a (remote) song is deleted from the playlist, there may still be
a reference to it in pc.errored_song. Clear this reference.
|
|
|
|
Removed the "volatile" attributes from several variables which are not
important for synchronization.
|
|
Renamed variables and internal functions. Most of the
player_control.h API remains in CamelCase for now.
|
|
"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.
|
|
QUEUE adds a new song to the player's queue. CANCEL clears the queue.
These two commands replace the old and complex queueState and
queueLockState code.
|
|
This variable is superfluous, it is only used to copy its value to
player_control.totalTime. Since the original source of this value
(song->tag->time) will still be available at this point, we can safely
remove fileTime.
|
|
player_get_audio_format() replaces getPlayerSampleRate(),
getPlayerBits(), getPlayerChannels().
|
|
This replaces the attributes bits, channels, sampleRate.
|
|
When there are standardized headers, use these instead of the bloated
os_compat.h.
|
|
Typedefs shouldn't be used, use the bare struct names instead.
|
|
Again, a data type which can be forward-declared.
|
|
Since we use a C99 compiler now, we can assert that the C99 standard
headers are available, no need for complicated compile time checks.
Kill mpd_types.h.
|
|
Do full C99 integer type conversion in all modules which were not
touched by Eric's merged patch.
|