aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/_flac_common.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-09-29Switch to C99 types (retaining compat with old compilers)Eric Wong1-2/+2
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.
2008-09-29flac: removed FlacData.chunk_lengthMax Kellermann1-6/+3
chunk_length can be converted to a local variable, because it is always reset to 0 after it was used.
2008-09-29flac: merged flacSendChunk() into flac_common_write()Max Kellermann1-11/+6
Since flacSendChunk() is a trivial function and is only used in one location, move the code there. The advantage is that calling decoder_data() directly returns the decoder_command value, so we can eliminate one decoder_get_command() call. [ew: using the terser API in the main branch, it always eliminated the dc_intr()/dc_seek() call, but I agree that killing a camel, err.. camelCase function is a good thing]
2008-09-29flac: removed generic sample size supportMax Kellermann1-31/+27
Support for bit rates except 16 bits (and 8 bits on little endian) has always been broken. Since we added optimized functions for 8, 16, 24/32 bits, we can remove the generic flac_convert() function. Instead of removing it, convert it to a wrapper function for flac_convert_*().
2008-09-29flac: added special functions for 8 and 32 bitMax Kellermann1-0/+37
Same optimization for 8 and 32 bit files, like the previous patch for 16 bit. Along the way, this patch adds 24 bit FLAC support!
2008-09-29flac: added optimized converter for 16 bitMax Kellermann1-0/+17
flac_convert_16() runs a lot faster than the generic (and quite buggy) function flac_convert(). flac_convert_16() is only used for non-stereo files, since there is already flac_convert_stereo16().
2008-09-29flac: use signed integers in flac_convert_stereo16()Max Kellermann1-6/+4
By mistake, I casted the sample value to uint16_t, which is wrong. This patch simplifies the code by using a int16_t pointer instead of casting to int16_t* every time.
2008-09-29flac: moved code from flacWrite() to _flac_common.cMax Kellermann1-0/+85
There is still a lot of duplicated code in flac_plugin.c and oggflac_plugin.c. Move code from flac_plugin.c to _flac_common.c, and use the new function flac_common_write() also in oggflac_plugin.c, porting lots of optimizations over to it.
2008-09-02tag: renamed functions, no CamelCaseMax Kellermann1-3/+3
2008-09-02tag: renamed MpdTag and MpdTagItem to struct mpd_tag, struct tag_itemMax Kellermann1-3/+3
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
2008-08-30clean up CPP includesMax Kellermann1-6/+0
Include only headers which are really required. This speeds up compilation and helps detect cross-layer accesses. [ew: minor fixups to not break on new core]
2008-08-30enable -Wpointer-arith, -Wstrict-prototypesMax Kellermann1-1/+1
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-08-16core rewrite (decode,player,outputBuffer,playlist)Eric Wong1-6/+5
This is a huge refactoring of the core mpd process. The queueing/buffering mechanism is heavily reworked. The player.c code has been merged into outputBuffer (the actual ring buffering logic is handled by ringbuf.c); and decode.c actually handles decoding stuff. The end result is several hundreds of lines shorter, even though we still have a lot of DEBUG statements left in there for tracing and a lot of assertions, too.
2008-04-13Make the OutputBuffer API more consistentEric Wong1-1/+1
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 Wong1-4/+2
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 Wong1-10/+7
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
2008-03-26explicitly downcastMax Kellermann1-3/+3
Tools like "sparse" check for missing downcasts, since implicit cast may be dangerous. Although that does not change the compiler result, it may make the code more readable (IMHO), because you always see when there may be data cut off. git-svn-id: https://svn.musicpd.org/mpd/trunk@7196 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-26fixed -Wshadow warningsMax Kellermann1-6/+6
Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7143 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-3/+1
This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-22fix Replay Gain reading for FLAC and OggFLACEric Wong1-6/+6
This bug was NOT introduced in my OggFLAC additions, honest! As far as I can see, it was introduced way back in r2482, but nobody ever noticed until the post here: http://www.musicpd.org/forum/index.php?topic=1152.0 While we're at it, clean up some of the variable typing. git-svn-id: https://svn.musicpd.org/mpd/trunk@4664 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-1/+1
Add a few new options for indent to try to make things a bit cleaner git-svn-id: https://svn.musicpd.org/mpd/trunk@4411 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-58/+66
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-1/+1
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-06-04gcc 2.95 compatibility fixesEric Wong1-2/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@4244 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-04-30Added Disc # metadata item based on bug 571 (added id3v2 support)Qball Cow1-2/+7
git-svn-id: https://svn.musicpd.org/mpd/trunk@4131 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-16merge with mpd/trunk up to r3925Eric Wong1-0/+195
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f