- 26 Oct, 2008 1 commit
-
-
Max Kellermann authored
These plugins are not input plugins, they are decoder plugins. No CamelCase in the directory name.
-
- 23 Oct, 2008 2 commits
-
-
Max Kellermann authored
libmad produces samples of more than 24 bit. Rounding that down to 16 bits using dithering makes those people lose quality who have a 24 bit capable sound device. Send 24 bit PCM data, and let the receiver decide whether to apply 16 bit dithering.
-
Max Kellermann authored
We are going to convert the code to 24 bit; don't hard-code a sample size of 2 bytes.
-
- 17 Oct, 2008 1 commit
-
-
Max Kellermann authored
Don't compile the sources of disabled decoder plugins at all, and don't attempt to register these.
-
- 10 Oct, 2008 3 commits
-
-
Max Kellermann authored
The mp3 plugin did not use the MAD_NCHANNELS() value correctly: when a stream was not stereo, it was assumed to be mono, although the correct number was passed to MPD. libmad doesn't support more than 2 channels, but this change allows gcc to optimize its inlining strategy.
-
Max Kellermann authored
The dithering function audio_linear_dither() worked for signed 16 bits only anyway, having a variable "bits" just disables important gcc optimizations.
-
Max Kellermann authored
The last bit of CamelCase in audio_format.h. Additionally, rename a bunch of local variables.
-
- 29 Sep, 2008 2 commits
-
-
Max Kellermann authored
The old struct initializers are error prone and don't allow moving elements around. Since we are going to overhaul some of the APIs soon, it's easier to have all implementations use C99 initializers.
-
Eric Wong authored
Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the mind needs to retrain itself to skip over the first 4 tokens of a type to get to its meaning. So avoid having extra characters on my terminal to make it easier to follow code at 2:30 am in the morning. Please report any new issues you may come across on Free toolchains. I realize how difficult it can be to build/maintain cross-compiling toolchains and I have no intention of forcing people to upgrade their toolchains to build mpd. Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
-
- 23 Sep, 2008 2 commits
- 17 Sep, 2008 1 commit
-
-
Max Kellermann authored
The function decodeFirstFrame() allocates memory based on data from the mp3 header. This can make the buffer size allocation overflow, or lead to a DoS attack with a very large buffer. Cap this buffer at 8 million frames, which should really be enough for reasonable files.
-
- 07 Sep, 2008 1 commit
-
-
Max Kellermann authored
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
-
- 29 Aug, 2008 2 commits
-
-
Max Kellermann authored
-
Max Kellermann authored
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
-
- 26 Aug, 2008 25 commits
-
-
Max Kellermann authored
When we introduced decoder_read(), we added code which aborts the read operation when a decoder command arrives. Several plugins however did not expect that when they were converted to decoder_read(). Add proper checks to the mp3 and flac decoder plugins.
-
Max Kellermann authored
The code said "decoder_command==STOP" because that was a conversion from the old "dc->stop" test. As we can now check for all commands in one test, we can simply rewrite that to decoder_command!=NONE.
-
Max Kellermann authored
Also introduce MUTEFRAME_NONE; previously, the code used "0".
-
Max Kellermann authored
-
Max Kellermann authored
On our way to stabilize the decoder API, we will one day remove the input stream functions. The most basic function, read() will be provided by decoder_api.h with this patch. It already contains a loop (still with manual polling), error/eof handling and decoder command checks. This kind of code used to be duplicated in all decoder plugins.
-
Max Kellermann authored
We need the decoder object at several places in the mp3 plugin. Add it to mp3DecodeData, so we don't have to pass it around in every function.
-
Max Kellermann authored
The return value of audio_linear_dither() is always casted to mpd_sint16. Returning long does not make sense, and consumed 8 bytes on a 64 bit platform.
-
Max Kellermann authored
The output buffer always contains mpd_sint16; declaring it with that type saves several casts.
-
Max Kellermann authored
The previous patch removed all loop specific dependencies from the num_samples formula; we can now calculate it before entering the loop.
-
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
"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
(Ab)use the decoder_command enumeration, which has nearly the same values and the same meaning.
-
Max Kellermann authored
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.
-
Max Kellermann authored
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().
-
Max Kellermann authored
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.
-
Max Kellermann authored
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".
-