Commit Graph

20 Commits

Author SHA1 Message Date
Max Kellermann
e28a0e97b5 decoder_control: protect command, state with a mutex
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-08-13 23:33:46 +02:00
Avuton Olrich
0aee49bdf8 all: Update copyright header.
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-13 11:51:55 -07:00
Max Kellermann
01cf7feac7 pipe: added music_buffer, rewrite music_pipe
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-06 00:42:03 +01:00
Max Kellermann
900784bb4e decoder_api: moved enum decoder_command to decoder_command.h
Minimize header dependencies, again.
2009-02-15 18:33:31 +01:00
Max Kellermann
ac0e799965 decoder_control: added decoder_control.thread
decoder_control.thread contains the handle of the decoder thread, or
NULL if the decoder thread isn't running.
2009-01-25 13:44:27 +01:00
Max Kellermann
8fe03b8bce decoder: terminate decoder thread before MPD cleanup
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-12-28 19:48:53 +01:00
Max Kellermann
72eba30cf4 decoder: converted dc.error to a dc.state value
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-08 15:48:00 +01:00
Max Kellermann
cfaf85e37d decoder: converted DECODE_ERROR_* to enum 2008-11-03 21:48:17 +01:00
Max Kellermann
ec6d26788a decoder: removed "volatile" modifier
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-03 21:44:12 +01:00
Max Kellermann
863badd91e decoder: no CamelCase
Renamed variables and functions.
2008-11-03 21:43:02 +01:00
Max Kellermann
8b1f6ff3c8 decoder: replaced music_pipe.audioFormat with dc.out_audio_format
.. 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-11-02 16:55:43 +01:00
Max Kellermann
ea515494cb added prefix to header macros
"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-31 09:19:53 +01:00
Max Kellermann
62d4fa9306 decoder: use bool for return values and flags
Don't return 0/-1 on success/error, but true/false.  Instead of int,
use bool for storing flags.
2008-10-30 08:38:54 +01:00
Max Kellermann
b159832418 notify: removed the "Notify" typedef
Typedefs shouldn't be used, use the bare struct names instead.
2008-10-08 10:49:16 +02:00
Max Kellermann
d562ba5fbb song: converted typedef Song to struct song
Again, a data type which can be forward-declared.
2008-10-08 10:49:11 +02:00
Max Kellermann
226d52b36f switch to C99 types, part II
Do full C99 integer type conversion in all modules which were not
touched by Eric's merged patch.
2008-09-29 15:49:29 +02:00
Max Kellermann
a0272c2d61 notify: added notify_deinit()
Destroy the mutex when it is not used anymore.
2008-09-24 07:14:11 +02:00
Max Kellermann
f1dd9c209c audio_format: converted typedef AudioFormat to struct audio_format
Get rid of CamelCase, and don't use a typedef, so we can
forward-declare it, and unclutter the include dependencies.
2008-09-07 19:19:55 +02:00
Max Kellermann
e2c8b960de moved code to pc_init(), dc_init() 2008-08-26 08:45:14 +02:00
Max Kellermann
56cdce6946 renamed decode.h to decoder_control.h 2008-08-26 08:44:19 +02:00