aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* notify: protect notify->pending with the mutexMax Kellermann2008-09-261-2/+0
| | | | | | | | | | There was a known deadlocking bug in the notify library: when the other thread set notify->pending after the according check in notify_wait(), the latter thread was deadlocked. Resolve this by synchronizing all accesses to notify->pending with the notify object's mutex. Since notify_signal_sync() was never used, we can remove it. As a consequence, we don't need notify_enter() and notify_leave() anymore; eliminate them, too.
* audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann2008-09-071-1/+1
| | | | | Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
* moved player_command_finished() to player_thread.cMax Kellermann2008-08-261-0/+8
|
* moved code to pc_init(), dc_init()Max Kellermann2008-08-261-3/+2
|
* renamed player.c to player_control.cMax Kellermann2008-08-261-1/+1
| | | | | Give player.c a better name, meaning that the code is used to control the player thread.
* renamed decode.h to decoder_control.hMax Kellermann2008-08-261-1/+1
|
* moved global variable "pc" to player.hMax Kellermann2008-08-261-0/+1
| | | | | This is the last of the three variables. Now we don't need playerData.h anymore in most sources.
* moved variable "dc" to decode.hMax Kellermann2008-08-261-6/+7
| | | | | Now that "dc" is available here, we don't have to pass it to decoder_is_idle() and decoder_is_starting() anymore.
* player_thread: removed decode(), renamed decodeParent()Max Kellermann2008-08-261-15/+4
| | | | | decode() is a trivial wrapper for decodeParent(). Merge both and rename them to do_play().
* hide DecoderControl accesses in inline functionsMax Kellermann2008-08-261-10/+6
| | | | | | 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.
* check for decoder error before state!=STARTMax Kellermann2008-08-261-9/+8
| | | | | When dc->error!=NOERROR, we do not need to check state!=START. Simplify the checks by moving the error check to the top.
* don't reset dc->command in quitDecode()Max Kellermann2008-08-261-1/+0
| | | | | | The decoder thread is responsible for resetting dc->command after a command was executed. As a consequence, we can assume that dc->command is already NONE after decoder_stop().
* added decoder_control.cMax Kellermann2008-08-261-50/+17
| | | | | | The source "decoder_control.c" provides an API for controlling the decoder. This replaces various direct accesses to the DecoderControl struct.
* fix a comment regarding the player queueMax Kellermann2008-08-261-1/+1
|
* rewrote playerKill()Max Kellermann2008-08-261-0/+8
| | | | | | | playerKill() was marked as deprecated, but it seems like a good idea to do proper cleanup in all threads (e.g. for usable valgrind results). Introduce the command "EXIT" which makes the player thread exit cleanly.
* player: don't call STOP before CLOSE_AUDIOMax Kellermann2008-08-261-1/+2
| | | | | | | | | playerWait() stops the player thread (twice!) and closes the output device. It should be well enough to just send CLOSE_AUDIO, without STOP. This requires a tiny change to the player thread code: make it break when CLOSE_AUDIO is sent.
* assert song->url != NULLMax Kellermann2008-08-261-0/+4
|
* don't call quitDecode() in waitOnDecode()Max Kellermann2008-08-261-2/+3
| | | | | To make the code more consistent, call quitDecode() only at the end of decodeParent().
* moved code to player_thread.cMax Kellermann2008-08-261-0/+466
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.