Commit Graph

35 Commits

Author SHA1 Message Date
Max Kellermann
0ea4c970d7 Merge branch 'v0.16.x'
Conflicts:
	src/player_thread.c
	src/playlist_control.c
2011-07-20 21:46:05 +02:00
Max Kellermann
a26f2ef17d pipe: lock the mutex in music_pipe_size() 2011-07-20 19:05:32 +02:00
Max Kellermann
c6cbcc2c25 copyright year 2011 2011-01-29 10:13:54 +01:00
Avuton Olrich
9d3865cb95 Update copyright notices. 2009-12-31 20:58:43 -08:00
Max Kellermann
5b82ffc291 include config.h in all sources
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-12 09:17:03 +01:00
Max Kellermann
1a9a65b23b music_pipe: added assertion on chunk->audio_format
Always assert that the audio format of the new chunk is valid.
2009-05-11 16:33:48 +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
e1bd2c65d5 music_pipe: added music_pipe_contains() 2009-03-09 19:15:54 +01:00
Max Kellermann
94d1a87d04 music_chunk: added assertions on the audio format
In !NDEBUG, remember which audio_format is stored in every chunk and
every pipe.  Check the audio_format of every new data block appended
to the music_chunk, and the format of every new chunk appended to the
music_pipe.
2009-03-08 13:45:24 +01:00
Max Kellermann
bd6bcfb676 music_pipe: refuse to push empty chunks
Added two assertions.
2009-03-07 21:41:25 +01:00
Max Kellermann
f8aebc52b5 music_pipe: poison music_chunk.next
The value of music_chunk.next is undefined for a chunk returned by
music_pipe_shift().  For more pedantic debugging, poison the reference
before returning the chunk.
2009-03-07 21:40:13 +01:00
Max Kellermann
39d3521956 music_pipe: added music_pipe_peek()
music_pipe_peek() is similar to music_pipe_shift(), but doesn't remove
the chunk.  This allows it to be used with a "const" music_pipe.
2009-03-07 19:56:31 +01: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
000b2d4f3a music_pipe: added music_pipe_push()
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-06 00:42:01 +01:00
Max Kellermann
74a2813d78 music_chunk: added music_chunk_write(), music_chunk_expand()
Moved some code from music_pipe_write() and music_pipe_expand().  Only
music_chunk.c should access the music_chunk internals.
2009-03-05 17:37:11 +01:00
Max Kellermann
c655f804a9 music_pipe: moved struct music_chunk to chunk.h 2009-03-03 22:23:25 +01:00
Max Kellermann
e726e2a004 music_pipe: removed music_pipe_append()
The function is unused, since decoder_api() uses music_pipe_write() /
music_pipe_expand() now.
2009-01-17 13:11:11 +01:00
Max Kellermann
fd948571f8 music_pipe: added functions music_pipe_write() and music_pipe_expand()
This new API gives the caller a writable buffer to the music pipe
chunk.  This may allow the caller to eliminate several buffer copies,
because it may manipulate the returned buffer, until it calls
music_pipe_expand().
2009-01-17 13:09:29 +01:00
Max Kellermann
63272d6888 music_pipe: narrowed assertion on chunk index
The chunk index passed to successor() must be valid, i.e. it must be
smaller than num_chunks.
2008-11-18 19:54:39 +01:00
Max Kellermann
709640422c player: chop the tail of the music pipe after CANCEL
When a CANCEL command is received, the player should drop all chunks
of the next song.  Added new funciton music_pipe_chop() which is used
for that.
2008-11-13 02:09:33 +01:00
Max Kellermann
66ce1495f0 music_pipe: continuously check the sample format of all chunks
Provide a debug function which asserts on the sample format of all
chunks.  Call this function in each iteration of the player main loop.
2008-11-13 02:06:58 +01:00
Max Kellermann
1178e485cb music_pipe: check for partial frames in appended chunk
Added an additional assertion which checks partial frames in the
existing tail chunk.
2008-11-13 02:06:52 +01:00
Max Kellermann
c7a374bdcb music_pipe: add tag pointer to the music_chunk struct
Each music chunk can now carry a tag object.  Decoder plugins which
support it (e.g. oggvorbis) may use this to inject decoded tags into
their output.
2008-11-02 17:01:00 +01:00
Max Kellermann
fcc11bc9d8 music_pipe: added functions chunk_init() and chunk_free()
These two functions will care about memory allocation and deallocation
in the future.
2008-11-02 16:58:49 +01:00
Max Kellermann
39bf84aa9f music_pipe: renamed "size" to "num_chunks"
The name "num_chunks" expresses the meaning of the variable better.
2008-11-02 16:57:37 +01:00
Max Kellermann
5347cca29d music_pipe: no CamelCase
Rename all variables and struct members.
2008-11-02 16:57:16 +01:00
Max Kellermann
8490c1b4cf music_pipe: set bit_rate and time in music_pipe_append()
Don't bother to pass these values as parameters to tail_chunk().
2008-11-02 16:57:15 +01:00
Max Kellermann
cd61f6570f music_pipe: moved code to music_chunk_append() 2008-11-02 16:56:49 +01:00
Max Kellermann
e9e9d2bc2d music_pipe: renamed "ob" to "music_pipe"
Last music_pipe rename patch: renamed the global variable (singleton).
2008-11-02 16:56:09 +01:00
Max Kellermann
260a0cc33c music_pipe: use GLib instead of utils.h
Eliminate the deprecated utils.h memory allocation functions.
2008-11-02 16:55:48 +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
30fca5e5a9 music_pipe: pass frame size to tail_chunk()
Don't make tail_chunk() calculate the frame size again.
2008-11-02 14:18:34 +01:00
Max Kellermann
fd0f195bb7 music_pipe: renamed ob_* functions to music_pipe_*
Rename all functions to the new prefix.
2008-11-02 14:18:34 +01:00
Max Kellermann
8964c69a64 music_pipe: renamed struct output_buffer to struct music_pipe
.. and rename ob_chunk to struct music_chunk.
2008-11-02 14:15:47 +01:00
Max Kellermann
767b4c95bd renamed outputBuffer.[ch] to pipe.[ch]
No CamelCase in the file name.  The output_buffer struct is going to
be renamed to music_pipe.  There are so many buffer levels in MPD, and
calling this one "output buffer" is wrong, because it's not the last
buffer before the music reaches the output devices.
2008-11-02 14:12:52 +01:00