aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/_flac_common.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Switch to C99 types (retaining compat with old compilers)Eric Wong2008-09-291-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.
* flac: removed FlacData.chunk_lengthMax Kellermann2008-09-291-6/+3
| | | | | chunk_length can be converted to a local variable, because it is always reset to 0 after it was used.
* flac: merged flacSendChunk() into flac_common_write()Max Kellermann2008-09-291-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]
* flac: removed generic sample size supportMax Kellermann2008-09-291-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_*().
* flac: added special functions for 8 and 32 bitMax Kellermann2008-09-291-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!
* flac: added optimized converter for 16 bitMax Kellermann2008-09-291-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().
* flac: use signed integers in flac_convert_stereo16()Max Kellermann2008-09-291-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.
* flac: moved code from flacWrite() to _flac_common.cMax Kellermann2008-09-291-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.
* tag: renamed functions, no CamelCaseMax Kellermann2008-09-021-3/+3
|
* tag: renamed MpdTag and MpdTagItem to struct mpd_tag, struct tag_itemMax Kellermann2008-09-021-3/+3
| | | | | Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
* clean up CPP includesMax Kellermann2008-08-301-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]
* enable -Wpointer-arith, -Wstrict-prototypesMax Kellermann2008-08-301-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.
* core rewrite (decode,player,outputBuffer,playlist)Eric Wong2008-08-161-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.
* Make the OutputBuffer API more consistentEric Wong2008-04-131-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
* Stop passing our single OutputBuffer object everywhereEric Wong2008-04-131-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
* Stop passing our single DecoderControl object everywhereEric Wong2008-04-131-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
* explicitly downcastMax Kellermann2008-03-261-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
* fixed -Wshadow warningsMax Kellermann2008-01-261-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
* Cleanup #includes of standard system headers and put them in one placeEric Wong2008-01-031-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
* The massive copyright updateAvuton Olrich2007-04-051-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix Replay Gain reading for FLAC and OggFLACEric Wong2006-08-221-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
* Add mpd-indent.shAvuton Olrich2006-07-201-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
* Add mpd-indent.shAvuton Olrich2006-07-201-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
* Change shank's email addressJ. Alexander Treuman2006-07-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-131-1/+1
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* gcc 2.95 compatibility fixesEric Wong2006-06-041-2/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4244 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added Disc # metadata item based on bug 571 (added id3v2 support)Qball Cow2006-04-301-2/+7
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4131 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge with mpd/trunk up to r3925Eric Wong2006-03-161-0/+195
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f