- 26 Aug, 2008 40 commits
-
-
Max Kellermann authored
The output buffer is always flushed after being appended to, which allows us to assume it is always empty. Always start writing at outputBuffer, don't remember outputPtr.
-
Max Kellermann authored
The previous patch made mp3Read() flush the output buffer in every iteration, which means we can eliminate the flush check after invoking mp3Read().
-
Max Kellermann authored
Since we try to fill the buffer in every iteration, we assume that we should flush the output buffer at the end of each iteration.
-
Max Kellermann authored
Fill the whole output buffer at a time by using dither_buffer()'s ability to decode blocks. Calculate how many samples fit into the output buffer before each invocation.
-
Max Kellermann authored
Simplifying loops for performance: why check dropSamplesAtEnd in every iteration, when we could modify the loop boundary? The (writable) variable samplesLeft can be eliminated; add a write-once variable pcm_length instead, which is used for the loop condition.
-
Max Kellermann authored
The variable samplesPerFrame is used only in one single closure. Make it local to this closure. The compiler will probably convert it to a register anyway.
-
Max Kellermann authored
-
Max Kellermann authored
cmd has already been checked before, it cannot have changed meanwhile because it is a local variable.
-
Max Kellermann authored
Preparing for simplifying and thus speeding up the dithering code: moved dithering to a separate function which contains a trivial loop. With this patch, only one sample is dithered at a time, but the following patches will allow us to dither a whole block at a time, without complicated buffer length checks.
-
Max Kellermann authored
Performance improvement by moving stuff out of a loop: skip part of the first frame before entering the loop.
-
Max Kellermann authored
-
Max Kellermann authored
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.
-
Max Kellermann authored
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.
-
Max Kellermann authored
The AAC plugin sometimes does not check the length of available data when checking for magic prefixes. Add length checks.
-
Max Kellermann authored
Eliminate some duplicated code by using fillAacBuffer().
-
Max Kellermann authored
Find AAC frames in the input and skip invalid data. This prepares AAC streaming.
-
Max Kellermann authored
adts_check_frame() checks whether the buffer head is an AAC frame, and returns the frame length.
-
Max Kellermann authored
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.
-
Max Kellermann authored
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.
-
Max Kellermann authored
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.
-
Max Kellermann authored
Return instead of putting all the code into a if-closure. That saves one level of indentation.
-
Max Kellermann authored
adtsParse() always returns 1, and its caller does not use the return value.
-
Max Kellermann authored
-
Max Kellermann authored
Since we eliminated the parameters retFileread and retTagsize in all callers, we can now safely remove it from the function prototype.
-
Max Kellermann authored
-
Max Kellermann authored
The flag "ready" indicates whether the input stream is ready and it has parsed all meta data. Previously, it was impossible for decodeStart() to see the content type of HTTP input streams, because at that time, the HTTP response wasn't parsed yet.
-
Max Kellermann authored
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".
-
Max Kellermann authored
To make the code more consistent, call quitDecode() only at the end of decodeParent().
-
Max Kellermann authored
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.
-
Max Kellermann authored
decode.c should be a lot smaller; start by moving all code which handles cross-fading to crossfade.c. Also includes camelCase conversion.
-
Max Kellermann authored
Make the code more readable by hiding big formulas in an inline function with a nice name.
-
Max Kellermann authored
Make calculateCrossFadeChunks() more generic and portable by eliminating global variable access.
-
Max Kellermann authored
Don't use CPP macros when you can use C enum... this also allows better type checking.
-
Max Kellermann authored
InputPlugin to decoder_plugin, and no camelCase.
-
Max Kellermann authored
-
Max Kellermann authored
Continuing the effort to rename InputPlugin to decoder_plugin...
-
Max Kellermann authored
Since inputPlugin.c manages the list of registered decoders, we should rename the source file.
-
Max Kellermann authored
The decoder_plugin instances are only used inputPlugin.c, so move them from the header file.
-
Max Kellermann authored
"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.
-
Max Kellermann authored
The function player_command() inherited the busy-waiting algorithm from the old code; throw in a wait_main_task() to do idle waiting.
-