| Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
After some of the commands, the player thread must have reset the
pc.next_song attribute.
|
|
|
|
Without the player error code, it errored_song variable is not used,
and should be cleared, to avoid invalid access in pc_song_deleted().
|
|
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.
|
|
The player thread must reset pc.next_song after seeking, even if that
operation has failed. This patch adds an assertion.
|
|
The only pc_seek() caller clears the error, rendering the check
useless. Even if the previous PLAY command resulted in a player
error, this check is not very useful.
|
|
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.
|
|
Assertions on pc.command and pc.next_song.
|
|
When the playlist is cleared, pc.errored_song is also cleared. This
causes pc_errored_song_uri() to crash, because it assumes that
pc.errored_song is set. Reset pc.error to fix that assumption.
|
|
player_control.thread contains the handle of the player thread, or
NULL if the player thread isn't running.
|
|
Moved the software volume code to a separate library.
|
|
|
|
There is only one location using PIPE_EVENT_SIGNAL: to synchronize
player_command() with player_command_finished(). Use the "notify"
library instead of the event_pipe here.
|
|
Continuing the previous patch.
|
|
We are going to migrate away from the concept of notifying the main
thread. There should be events sent to it instead. This patch starts
a series to implement that.
|
|
Only include headers which are really needed. os_compat.h aimed to
make MPD easily portable, but was never actually made portable.
|
|
getPlayerErrorStr() assumes that pc.errored_song is set when an error
occured. Since the song may have been deleted meanwhile, add a NULL
check.
|
|
When a (remote) song is deleted from the playlist, there may still be
a reference to it in pc.errored_song. Clear this reference.
|
|
It may be desirable to change the range of integer volume levels
(e.g. to 1024, which may utilize shifts instead of expensive integer
divisions). Introduce the constant PCM_VOLUME_1 which describes the
integer value for "100% volume". This is currently 1000.
|
|
|
|
Renamed variables and internal functions. Most of the
player_control.h API remains in CamelCase for now.
|
|
"idle" waits until something noteworthy happens on the server,
e.g. song change, playlist modified, database updated. This allows
clients to keep up to date without polling.
|
|
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.
|
|
set_current_song() is an internal function and consists of only one
assignment. Eliminate it.
|
|
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.
|
|
CamelCase is ugly... rename all functions.
|
|
Again, a data type which can be forward-declared.
|
|
Destroy the mutex when it is not used anymore.
|
|
As usual, include only headers which are really needed.
|
|
|
|
|
|
Give player.c a better name, meaning that the code is used to control
the player thread.
|
|
This is the last of the three variables. Now we don't need
playerData.h anymore in most sources.
|
|
Move code which runs in the player thread to player_thread.c. Having
a lot of player thread code in decode.c isn't easy to understand.
|
|
"decoder plugin" is a better name than "input plugin", since the
plugin does not actually do the input - InputStream does. Also don't
use typedef, so we can forward-declare it if required.
|
|
Since we moved all PCM conversions to decoder_data(), the attribute
convState isn't being used anymore by the OutputBuffer code. Move it
to struct decoder.
|
|
The decoder struct should later be made opaque to the decoder plugin,
because maintaining a stable struct ABI is quite difficult. The ABI
should only consist of a small number of stable functions.
|
|
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
|
|
[ew: cleaned up the dirty union hack a bit]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
thread-safety work in preparation for rewrite to use pthreads
Expect no regressions against trunk (r7078), possibly minor
performance improvements in update (due to fewer heap
allocations), but increased stack usage.
Applied the following patches:
* maxpath_str for reentrancy (temporary fix, reverted)
* path: start working on thread-safe variants of these methods
* Re-entrancy work on path/character-set conversions
* directory.c: exploreDirectory() use reentrant functions here
* directory/update: more use of reentrant functions + cleanups
* string_toupper: a strdup-less version of strDupToUpper
* get_song_url: a static-variable-free version of getSongUrl()
* Use reentrant/thread-safe get_song_url everywhere
* replace rmp2amp with the reentrant version, rmp2amp_r
* Get rid of the non-reentrant/non-thread-safe rpp2app, too.
* buffer2array: assert strdup() returns a usable value in unit tests
* replace utf8ToFsCharset and fsCharsetToUtf8 with thread-safe variants
* fix storing playlists w/o absolute paths
* parent_path(), a reentrant version of parentPath()
* parentPath => parent_path for reentrancy and thread-safety
* allow "make test" to automatically run embedded unit tests
* remove convStrDup() and maxpath_str()
* use MPD_PATH_MAX everywhere instead of MAXPATHLEN
* path: get rid of appendSlash, pfx_path and just use pfx_dir
* get_song_url: fix the ability to play songs in the top-level music_directory
git-svn-id: https://svn.musicpd.org/mpd/trunk@7106 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|