aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderAPI.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2011-10-05decoder_control: add attributes start_ms, end_msMax Kellermann1-4/+4
Don't read song.start_ms and song.end_ms, let the player thread manage this logic instead.
2011-10-05decoder_api: don't copy tag to pipe during initial seekMax Kellermann1-3/+8
Fixes one more assertion failure.
2011-10-04decoder_api: clear initial_seek_running on errorMax Kellermann1-1/+3
Fixes possible assertion failure.
2011-09-22decoder_api: emulate SEEK command for initial seek to CUE trackMax Kellermann1-6/+57
When playing a CUE track, the player thread waited for the decoder to become ready, and then sent a SEEK command to the beginning of the CUE track. If that is near the start of the song file, and the track is short enough, the decoder could have finished decoding already at that point, and seeking fails. This commit makes this initial seek more robust: instead of letting the player thread deal with the difficult timings, let the decoder API emulate a SEEK command, and return it to the decoder plugin, as soon as the plugin finishes its initialization.
2011-09-16input_stream: non-blocking I/OMax Kellermann1-3/+16
Add GMutex, GCond attributes which will be used by callers to conditionally wait on the stream. Remove the (now-useless) plugin method buffer(), wait on GCond instead. Lock the input_stream before each method call. Do the same with the playlist plugins.
2011-09-16decoder_api: remove the loop from decoder_read()Max Kellermann1-16/+10
This was useless, because input_stream_read() blocks until data is available. Calling it in a loop doesn't make sense.
2011-09-16decoder_api: move code to decoder_check_cancel_read()Max Kellermann1-12/+28
2011-09-14decoder_internal: don't call input_stream_buffer()Max Kellermann1-8/+7
This is not necessary since all relevant input plugins have been moved to the I/O thread, and there is no remaining useful buffer() implementation. This also fixes a busy loop when playing radio.
2011-01-29copyright year 2011Max Kellermann1-1/+1
2011-01-10decoder_control: store GCond object, not a player_controlMax Kellermann1-9/+6
Remove the decoder dependency on player_control. All player_control was needed for is to signal the player thread, and we can do that with a simple GCond as well.
2011-01-10player_control: removed the global variable "pc"Max Kellermann1-6/+6
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.
2010-05-30filter/replay_gain: added option "replaygain_limit"Daniel Seuthe1-1/+2
2010-05-18decoder_api: return effective replay gainDaniel Seuthe1-1/+1
Pay attention to the ReplayGain mode "auto" and the replay_gain_missing_preamp parameter inside of decoder_replay_gain().
2010-05-08mixramp: Adjust MixRamp threshold to account for ReplayGain.Tim Phipps1-2/+14
2010-03-21Add support for MixRamp tagsTim Phipps1-0/+12
Adds mixrampdb and mixrampdelay commands. Reads MIXRAP_START and MIXRAMP_END tags from FLAC files and overlaps instead of crossfading.
2010-03-17decoder_api: use the correct format to calculate elapsed timeMax Kellermann1-1/+1
When decoder->timestamp is calculated, the PCM data is already converted to out_audio_format; using in_audio_format may cause funny speedups/slowdowns.
2010-02-17replay_gain: reimplement as a filter pluginMax Kellermann1-10/+17
Apply the replay gain in the output thread. This means a new setting will be active instantly, without going through the whole music pipe. And we might have different replay gain settings for each audio output device.
2010-01-18decoder_api: removed function decoder_get_uri()Max Kellermann1-9/+0
Use input_stream.uri.
2010-01-04replay_gain: moved code to replay_gain_config.cMax Kellermann1-1/+1
2010-01-04replay_gain: moved code to replay_gain_info.cMax Kellermann1-0/+1
2010-01-04replay_gain: refactor API, move code to replay_gain_state.cMax Kellermann1-10/+6
The replay_gain_state struct holds the precalculated scale factor, which is removed from struct replay_gain_info.
2010-01-04decoder_api: added function decoder_replay_gain()Max Kellermann1-3/+17
This function replaces the replay_gain_info parameter for decoder_data(). This allows the decoder to announce replay gain changes, instead of having to pass the same object over and over.
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-12-27decoder, player: support song rangesMax Kellermann1-2/+9
Seek the decoder to the start of the range before beginning with playback. Stop the decoder when the end of the range has been reached. Add the start position to the seek position. Expose the duration of the range, not the full song file.
2009-12-26decoder_api: added function decoder_timestamp()Max Kellermann1-3/+19
Remove the data_time parameter from decoder_data(). This patch eliminates the timestamp counting in most decoder plugins, because the MPD core will do it automatically by default.
2009-12-26decoder_thread: eliminate jitter after seek failureMax Kellermann1-1/+5
Don't clear the music pipe when seeking has failed - check the "seeking" flag instead of "command==SEEK". Clear the "seeking" flag in decoder_seek_error().
2009-12-25output_init: use the normalize filter pluginMax Kellermann1-4/+0
Use the plugin instead of the glue code in normalize.c. This is used wrapped inside a "autoconv" filter, to enable normalization for all input file formats.
2009-12-15input_stream: return errors with GErrorMax Kellermann1-1/+9
2009-12-14fixed several gcc warnings on unused debug variablesMax Kellermann1-1/+1
2009-12-07decoder_api: prefer stream_tag over decoder_tagThomas Jansen1-2/+2
If both tags (stream and decoder) are present, we prefer the stream tag. Fixes #2698, where ICY tag contained useful information, but was overwritten with bogus decoder tag data.
2009-11-14audio_format: added function audio_format_to_string()Max Kellermann1-8/+6
Unified function for converting an audio_format object to a string, for log messages and for the "status" command.
2009-11-12include config.h in all sourcesMax Kellermann1-0/+1
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.
2009-11-03decoder_control: merge next_song and current_songMax Kellermann1-1/+1
These two variables are redundant, we need only one of them.
2009-11-01decoder_api: check decoder==NULL in decoder_read()Max Kellermann1-1/+2
It's legal to pass decoder=NULL to decoder_read(). Add a check.
2009-10-31decoder_control: removed the global variable "dc"Max Kellermann1-62/+80
Allocate a decoder_control object where needed, and pass it around. This will allow more than one decoder thread one day.
2009-10-31player_control: protect command, state, error with a mutexMax Kellermann1-5/+5
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.
2009-08-13decoder_control: protect command, state with a mutexMax Kellermann1-5/+14
Replace decoder_control.notify with decoder_control.mutex and decoder_control.cond. Lock the mutex on all accesses to decoder_control.command and decoder_control.state.
2009-07-23pcm_convert: use GError for error handlingMax Kellermann1-8/+10
Don't abort the whole MPD process when the conversion fails. This has been a denial-of-service attack vector for years.
2009-06-25Preamp for missing replay-gainDaniel Seuthe1-2/+1
2009-04-26decoder_api: removed dc.pipe assertion from decoder_read()Max Kellermann1-1/+0
Database update was broken due to the dc.pipe!=NULL assertion. This assertion is only valid while MPD decodes a song, not during database update.
2009-04-25decoder: added assertions on dc.pipeMax Kellermann1-0/+11
dc.pipe must be non-NULL while the decoder thread is running. Ensure that with a load of assertions.
2009-04-13decoder_api: submit the song tag to the music pipeMax Kellermann1-6/+12
When a new song starts playing, send its tag (song->tag) to the music pipe. This allows output plugins to render tags for all songs, not only those with embedded tags understood by the decoder plugin.
2009-03-13all: Update copyright header.Avuton Olrich1-7/+7
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.
2009-03-06pipe: added music_buffer, rewrite music_pipeMax Kellermann1-16/+21
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.
2009-03-06music_pipe: added music_pipe_push()Max Kellermann1-33/+45
Added music_pipe_allocate(), music_pipe_push() and music_pipe_cancel(). Those functions allow the caller (decoder thread in this case) to do its own chunk management. The functions music_pipe_flush() and music_pipe_tag() can now be removed.
2009-03-01decoder_api: log audio format in a debug messageMax Kellermann1-0/+14
To aid debugging, print the audio format of the decoder plugin in a debug message, and print information about PCM conversion.
2009-02-19decoder_api: fixed shadow warning, rename "wait"Max Kellermann1-2/+2
The parameter name "wait" overlaps with the POSIX wait() function. Rename it.
2009-02-19utils: use g_usleep() instead of my_usleep()Max Kellermann1-2/+1
Now that I've found this nice function in the GLib docs, we can finally remove our custom sleep function. Still all those callers of g_usleep() have to be migrated one day to use events, instead of regular polling.
2009-02-15decoder_api: moved struct decoder_plugin to decoder_plugin.hMax Kellermann1-0/+1
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.
2009-01-17decoder_api: always notify_wait() for free chunksMax Kellermann1-2/+1
One of the previous patches made MPD consume 100% CPU in a busy wait: when the music_pipe was full, it did not wait (with notify_wait()) for free chunks, because a variable has a different meaning now. Always pass "true" as the "wait" parameter.