aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-08-26mp3: don't check dropSamplesAtStart in the loopMax Kellermann1-7/+14
Performance improvement by moving stuff out of a loop: skip part of the first frame before entering the loop.
2008-08-26aac: support decoding AAC streamsMax Kellermann1-2/+137
Copy some code from aac_decode() to aac_stream_decode() and apply necessary changes to allow streaming audio data. Both functions might be merged later.
2008-08-26aac: splitted aac_parse_header() from initAacBuffer()Max Kellermann1-11/+16
initAacBuffer() should really only initialize the buffer; currently, it also reads data from the input stream and parses the header. All of the AAC buffer code should probably be moved to a separate library anyway.
2008-08-26aac: check buffer lengthsMax Kellermann1-2/+3
The AAC plugin sometimes does not check the length of available data when checking for magic prefixes. Add length checks.
2008-08-26aac: use fillAacBuffer() instead of manual readingMax Kellermann1-16/+4
Eliminate some duplicated code by using fillAacBuffer().
2008-08-26find AAC framesMax Kellermann1-1/+35
Find AAC frames in the input and skip invalid data. This prepares AAC streaming.
2008-08-26aac: moved code to adts_check_frame()Max Kellermann1-11/+20
adts_check_frame() checks whether the buffer head is an AAC frame, and returns the frame length.
2008-08-26aac: moved code to aac_buffer_shift()Max Kellermann1-7/+14
Shifting from the buffer queue is a common operation, and should be provided as a separate function. Move code to aac_buffer_shift() and add a bunch of assertions.
2008-08-26aac: use inputStreamAtEOF()Max Kellermann1-5/+4
When checking for EOF, we should not check whether the read request has been fully satisified. The InputStream API does not guarantee that readFromInputStream() always fills the whole buffer, if EOF is not reached. Since there is the function inputStreamAtEOF() dedicated for this purpose, we should use it for EOF checking after readFromInputStream()==0.
2008-08-26aac: don't depend on consumed data in fillAacBuffer()Max Kellermann1-6/+10
Fill the AacBuffer even when nothing has been consumed yet. The function should not check for consumed data, but for free space at the end of the buffer.
2008-08-26aac: simplified fillAacBuffer()Max Kellermann1-33/+25
Return instead of putting all the code into a if-closure. That saves one level of indentation.
2008-08-26aac: make adtsParse() voidMax Kellermann1-3/+1
adtsParse() always returns 1, and its caller does not use the return value.
2008-08-26aac: use size_tMax Kellermann1-6/+6
2008-08-26aac: removed unused initAacBuffer() parametersMax Kellermann1-9/+3
Since we eliminated the parameters retFileread and retTagsize in all callers, we can now safely remove it from the function prototype.
2008-08-26eliminate unused variables in the AAC decoderMax Kellermann1-10/+2
2008-08-26added decoder_plugin_register()Max Kellermann1-2/+1
With the functions decoder_plugin_register() and decoder_plugin_unregister(), decoder plugins can register a "secondary" plugin, like the flac input plugin does this for "oggflac".
2008-08-26renamed functions in decoder_list.hMax Kellermann1-1/+1
InputPlugin to decoder_plugin, and no camelCase.
2008-08-26no camel case in struct decoder_pluginMax Kellermann1-5/+5
2008-08-26renamed inputPlugin.* to decoder_list.*Max Kellermann1-1/+1
Since inputPlugin.c manages the list of registered decoders, we should rename the source file.
2008-08-26renamed InputPlugin to struct decoder_pluginMax Kellermann10-21/+21
"decoder plugin" is a better name than "input plugin", since the plugin does not actually do the input - InputStream does. Also don't use typedef, so we can forward-declare it if required.
2008-08-26eliminate OUTPUT_BUFFER_DC_STOP, OUTPUT_BUFFER_DC_SEEKMax Kellermann2-4/+5
(Ab)use the decoder_command enumeration, which has nearly the same values and the same meaning.
2008-08-26added decoder_get_url()Max Kellermann1-1/+1
The wavpack decoder plugin implements a hack, and it needs the song URL for that. This API (and the hack) should be revised later, but add that function for now.
2008-08-26don't set dc->seekable in wavpack pluginMax Kellermann1-2/+0
dc->seekable is already set by decodeStart().
2008-08-26use a local "initialized" flag instead of dc->stateMax Kellermann3-5/+11
Since we want to hide mpd internals from the decoder plugins, the plugins should not check dc->state whether they have already called decoder_initialized(). Use a local variable to track that.
2008-08-26added decoder_seek_where() and decoder_seek_error()Max Kellermann10-40/+40
Provide access to seeking for the decoder plugins; they have to know where to seek, and they need a way to tell us that seeking has failed.
2008-08-26added decoder_command_finished() to decoder_api.hMax Kellermann10-15/+15
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-26added decoder_get_command()Max Kellermann11-59/+67
Another big patch which hides internal mpd APIs from decoder plugins: decoder plugins regularly poll dc->command; expose it with a decoder_api.h function.
2008-08-26moved InputPlugin to decoder_api.hMax Kellermann4-4/+3
InputPlugin is the API which is implemented by a decoder plugin. This belongs to the public API/ABI, so move it to decoder_api.h. It will later be renamed to something like "decoder_plugin".
2008-08-26remove one indent level from audiofile pluginMax Kellermann1-30/+25
Anonymous code blocks just to declare variables look ugly. Move the variable declarations up and disband the code block.
2008-08-26use break instead of local variable "eof"Max Kellermann1-16/+12
Similar to previous patch: eliminate one variable by using "break". This also simplifies the code since we can remove one level of indent.
2008-08-26removed local variable "eof" because it is unusedMax Kellermann2-19/+9
"break" is so much easier than "eof=1; continue;", when "!eof" is the loop condition.
2008-08-26simplify several dc->command checksMax Kellermann1-7/+3
Since we have merged dc->stop, dc->seek into one variable, we don't have to check both conditions at a time; we can replace "!stop && !seek" with "none".
2008-08-26added parameter total_time to decoder_initialized()Max Kellermann12-27/+25
Similar to the previous patch: pass total_time instead of manipulating dc->totalTime directly.
2008-08-26added audio_format parameter to decoder_initialized()Max Kellermann12-81/+78
dc->audioFormat is set once by the decoder plugins before invoking decoder_initialized(); hide dc->audioFormat and let the decoder pass an AudioFormat pointer to decoder_initialized().
2008-08-26added decoder_clear() and decoder_flush()Max Kellermann10-22/+21
We are now beginning to remove direct structure accesses from the decoder plugins. decoder_clear() and decoder_flush() mask two very common buffer functions.
2008-08-26added decoder_data()Max Kellermann9-59/+58
Moved all of the player-waiting code to decoder_data(), to make OutputBuffer more generic.
2008-08-26added decoder_initialized()Max Kellermann11-31/+28
decoder_initialized() sets the state to DECODE_STATE_DECODE and wakes up the player thread. It is called by the decoder plugin after its internal initialization is finished. More arguments will be added later to prevent direct accesses to the DecoderControl struct.
2008-08-26added struct decoderMax Kellermann12-23/+35
The decoder struct should later be made opaque to the decoder plugin, because maintaining a stable struct ABI is quite difficult. The ABI should only consist of a small number of stable functions.
2008-08-26added dc_command_finished()Max Kellermann10-30/+15
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 Kellermann11-80/+95
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-26clean up CPP includesMax Kellermann13-64/+0
Include only headers which are really required. This speeds up compilation and helps detect cross-layer accesses.
2008-08-26enable -Wpointer-arith, -Wstrict-prototypesMax Kellermann4-10/+11
Also enable -Wunused-parameter - this forces us to add the gcc "unused" attribute to a lot of parameters (mostly library callback functions), but it's worth it during code refactorizations.
2008-06-30don't call seekInputStream(0) if r==0Max Kellermann1-1/+2
If nothing has been read from the input stream, we don't have to rewind it. git-svn-id: https://svn.musicpd.org/mpd/trunk@7397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-06-30eliminated local variable "to_read"Max Kellermann1-4/+3
The variable "to_read" is never modified except in the last iteration of the while loop. This means the while condition will never become false, as the body will break before that may be checked. git-svn-id: https://svn.musicpd.org/mpd/trunk@7396 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-06-13mod: fix crashing on modtracker filesHans de Goede1-1/+1
This patch was taken from http://bugzilla.livna.org/show_bug.cgi?id=1987 and addresses bug 0001693[1] [1] - http://musicpd.org/mantis/view.php?id=1693 git-svn-id: https://svn.musicpd.org/mpd/trunk@7374 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-06-01oggflac_plugin: fix build with libOggFLAC lib (libFLAC <= 7)Eric Wong1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@7370 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-15use dc.current_song instead of pc.current_songMax Kellermann1-1/+1
When we are in an input plugin, dc.current_song should already be set. Use it instead of pc.current_song. git-svn-id: https://svn.musicpd.org/mpd/trunk@7363 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Make the OutputBuffer API more consistentEric Wong12-42/+42
We had functions names varied between outputBufferFoo, fooOutputBuffer, and output_buffer_foo That was too confusing for my little brain to handle. And the global variable was somehow named 'cb' instead of the more obvious 'ob'... git-svn-id: https://svn.musicpd.org/mpd/trunk@7355 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Stop passing our single OutputBuffer object everywhereEric Wong12-86/+77
All of our main singleton data structures are implicitly shared, so there's no reason to keep passing them around and around in the stack and making our internal API harder to deal with. git-svn-id: https://svn.musicpd.org/mpd/trunk@7354 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Stop passing our single DecoderControl object everywhereEric Wong12-244/+222
This at least makes the argument list to a lot of our plugin functions shorter and removes a good amount of line nois^W^Wcode, hopefully making things easier to read and follow. git-svn-id: https://svn.musicpd.org/mpd/trunk@7353 09075e82-0dd4-0310-85a5-a0d7c8717e4f