aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_control.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2011-01-29copyright year 2011Max Kellermann1-1/+1
2011-01-10decoder_control: store GCond object, not a player_controlMax Kellermann1-9/+7
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-10decoder_control: remove unused function dc_command_wait()Max Kellermann1-3/+0
Only dc_command_wait_locked() is really being used.
2011-01-10decoder_control: replace dc_init() with dc_new()Max Kellermann1-3/+4
dc_new() allocates the object and returns it. dc_free() frees it (replaces dc_deinit()).
2011-01-10player_control: removed the global variable "pc"Max Kellermann1-1/+9
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-11-05decoder_control: pass music_pipe to dc_start()Max Kellermann1-2/+2
More abstraction for decoder_control.pipe.
2010-05-08mixramp: Adjust MixRamp threshold to account for ReplayGain.Tim Phipps1-0/+2
2010-03-21Add support for MixRamp tagsTim Phipps1-0/+13
Adds mixrampdb and mixrampdelay commands. Reads MIXRAP_START and MIXRAMP_END tags from FLAC files and overlaps instead of crossfading.
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-11-03decoder_control: pass pipe and buffer to dc_start()Max Kellermann1-2/+14
Don't access decoder_control attributes directly.
2009-11-03decoder_control: don't check command in decoder_is_starting()Max Kellermann1-5/+3
Asynchronous decoder startup is gone, and we don't need to check command==DECODE_COMMAND_START anymore.
2009-11-03decoder_control: merge next_song and current_songMax Kellermann1-3/+8
These two variables are redundant, we need only one of them.
2009-11-03player_thread: don't start the decoder asynchronouslyMax Kellermann1-3/+0
The START command returns without blocking; we don't need the asynchronous decoder start anymore.
2009-11-03decoder_control: make the song objects constMax Kellermann1-2/+2
They are just informational.
2009-10-31decoder_control: removed the global variable "dc"Max Kellermann1-44/+50
Allocate a decoder_control object where needed, and pass it around. This will allow more than one decoder thread one day.
2009-10-31decoder_control: removed unused DECODE_TYPE macrosMax Kellermann1-3/+0
2009-10-31player_control: protect command, state, error with a mutexMax Kellermann1-6/+4
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/+92
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-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-0/+6
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-02-15decoder_api: moved enum decoder_command to decoder_command.hMax Kellermann1-2/+1
Minimize header dependencies, again.
2009-01-25decoder_control: added decoder_control.threadMax Kellermann1-1/+5
decoder_control.thread contains the handle of the decoder thread, or NULL if the decoder thread isn't running.
2008-12-28decoder: terminate decoder thread before MPD cleanupMax Kellermann1-0/+4
When MPD exits, it should manually free all resources in use, to allow easy memory leak debugging. Make the decoder thread terminate during that.
2008-11-08decoder: converted dc.error to a dc.state valueMax Kellermann1-12/+30
The player did not care about the exact error value, it only checked whether an error has occured. This could fit well into decoder_control.state - introduce a new state "DECODE_STATE_ERROR".
2008-11-03decoder: converted DECODE_ERROR_* to enumMax Kellermann1-4/+6
2008-11-03decoder: removed "volatile" modifierMax Kellermann1-2/+2
The variable "next_song" is already protected by a memory barrier. "total_time" is not important for synchronization, and we don't need "volatile" here.
2008-11-03decoder: no CamelCaseMax Kellermann1-3/+3
Renamed variables and functions.
2008-11-02decoder: replaced music_pipe.audioFormat with dc.out_audio_formatMax Kellermann1-1/+7
.. and rename dc.audioFormat to dc.in_audio_format. The music pipe does not need to know the audio format, and its former "audioFormat" property indicated the format of the most recently added chunk, which might be confusing when you are reading the oldest chunks.
2008-10-31added prefix to header macrosMax Kellermann1-2/+2
"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.
2008-10-30decoder: use bool for return values and flagsMax Kellermann1-5/+5
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-08notify: removed the "Notify" typedefMax Kellermann1-5/+8
Typedefs shouldn't be used, use the bare struct names instead.
2008-10-08song: converted typedef Song to struct songMax Kellermann1-6/+8
Again, a data type which can be forward-declared.
2008-09-29switch to C99 types, part IIMax Kellermann1-3/+3
Do full C99 integer type conversion in all modules which were not touched by Eric's merged patch.
2008-09-24notify: added notify_deinit()Max Kellermann1-0/+2
Destroy the mutex when it is not used anymore.
2008-09-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-1/+1
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-08-26moved code to pc_init(), dc_init()Max Kellermann1-0/+2
2008-08-26renamed decode.h to decoder_control.hMax Kellermann1-0/+1
2008-08-26renamed decode.c to decoder_thread.cMax Kellermann1-2/+0
It should be obvious in which thread or context a function is being executed at runtime. The code which was left in decode.c is for the decoder thread itself; give the file a better name.
2008-08-26moved enum decoder_command to decoder_api.hMax Kellermann1-7/+1
The decoder plugins need this type, so export it in the public API. This allows is to remove "decode.h" from "decoder_api.h", uncluttering the API namespace some more.
2008-08-26moved variable "dc" to decode.hMax Kellermann1-12/+14
Now that "dc" is available here, we don't have to pass it to decoder_is_idle() and decoder_is_starting() anymore.
2008-08-26hide DecoderControl accesses in inline functionsMax Kellermann1-0/+21
Unfortunately, we have to pass the DecoderControl pointer to these inline functions, because the global variable "dc" may not be available here. This will be fixed later.
2008-08-26added decoder_control.cMax Kellermann1-0/+10
The source "decoder_control.c" provides an API for controlling the decoder. This replaces various direct accesses to the DecoderControl struct.
2008-08-26moved code to player_thread.cMax Kellermann1-2/+0
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.
2008-08-26added decoder_command_finished() to decoder_api.hMax Kellermann1-7/+0
Some decoder commands are implemented in the decoder plugins, thus they need to have an API call to signal that their current command has been finished. Let them use the new decoder_command_finished() instead of the internal dc_command_finished().
2008-08-26moved struct AudioFormat to audio_format.hMax Kellermann1-1/+1
We want to expose the AudioFormat structure to plugins; remove some clutter by moving its declaration to a separate header file.
2008-08-26invoke the notify API directlyMax Kellermann1-4/+0
Don't use wrappers like player_wakeup_decoder_nb(). These have been wrappers calling notify.c functions, for compatibility with the existing code when we migrated to notify.c.
2008-08-26added dc_command_finished()Max Kellermann1-0/+7
dc_command_finished() is invoked by the decoder thread when it has finished a command (sent by the player thread). It resets dc.command and wakes up the player thread. This combination was used at a lot of places, and by introducing this function, the code will be more readable.
2008-08-26merged start, stop, seek into DecoderControl.commandMax Kellermann1-3/+8
Much of the existing code queries all three variables sequentially. Since only one of them can be set at a time, this can be optimized and unified by merging all of them into one enum variable. Later, the "command" checks can be expressed in a "switch" statement.
2008-08-26added dc.next_song, renamed pc.current_songMax Kellermann1-0/+1
Since pc->current_song denotes the song which the decoder should use next, we should move it to DecoderControl. This removes one internal PlayerControl struct access from the decoder code. Also add pc.next_song, which is manipulated by the playlist code, and gets copied to dc.next_song as soon as the decoder is started.
2008-06-01make DecoderControl.state an enumMax Kellerman1-4/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@7369 09075e82-0dd4-0310-85a5-a0d7c8717e4f