aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_convert.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2011-03-31fix common misspellingsJonathan Neuschäfer1-1/+1
These fixes were mostly generated with `codespell' [0] and manually reviewed. [0] http://git.profusion.mobi/cgit.cgi/lucas/codespell/
2011-01-29copyright year 2011Max Kellermann1-1/+1
2010-01-16audio_format: support packed 24 bit samplesMax Kellermann1-0/+3
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-07-23pcm_convert: use GError for error handlingMax Kellermann1-2/+11
Don't abort the whole MPD process when the conversion fails. This has been a denial-of-service attack vector for years.
2009-07-22pcm_convert: added pcm_convert_state.byteswap_bufferMax Kellermann1-0/+3
Currently, byteswapping is performed on the format_buffer. This can go wrong when this buffer is used twice during one run. Add a separate buffer for swapping the byte order.
2009-03-13all: Update copyright header.Avuton Olrich1-3/+4
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-03-02pcm_dither: renamed struct pcm_dither_24 to struct pcm_ditherMax Kellermann1-1/+1
There is nothing 24 bit specific in the pcm_dither_24 struct. Since we want to reuse the struct for 32 bit dithering, let's drop the "_24" suffix from the struct name.
2009-02-21pcm: added API documentationMax Kellermann1-0/+23
2009-02-17pcm_convert: removed pcm_convert_size()Max Kellermann1-3/+0
The function is unused, since we added the pcm_buffer library.
2009-01-17pcm_convert: return PCM buffer from pcm_convert()Max Kellermann1-5/+6
Removed yet another superfluous buffer layer: return the PCM buffer from pcm_convert() instead of copying PCM data into the caller-supplied buffer.
2009-01-07pcm_channels: use pcm_bufferMax Kellermann1-0/+3
Replace a "static" buffer with the PCM buffer library.
2009-01-07pcm_format: use the pcm_buffer libraryMax Kellermann1-0/+4
Replace a "static" buffer with the PCM buffer library.
2009-01-07pcm: added pcm_convert_deinit(), pcm_resample_deinit()Max Kellermann1-0/+2
Free memory allocated by libsamplerate when the output or the decoder is closed.
2009-01-07pcm: pass void pointers to PCM functionsMax Kellermann1-2/+2
In generic PCM functions allowing all sample formats, pass a void pointer instead of a char pointer.
2009-01-07pcm_utils: moved conversion code to pcm_convert.cMax Kellermann1-27/+5
All what's left in pcm_utils.h is the pcm_range() utility function, which is only used internally by pcm_volume and pcm_mix.
2009-01-07pcm_utils: moved code to pcm_mix.cMax Kellermann1-3/+0
Moved the software mixing code (used by crossfading) to a separate library.
2009-01-07pcm_utils: moved code to pcm_volume.cMax Kellermann1-19/+0
Moved the software volume code to a separate library.
2009-01-07pcm_utils: export pcm_range()Max Kellermann1-0/+16
We are going to split the pcm_utils.c library, and pcm_range() will be useful for several sub libraries.
2008-11-11pcm_volume: added constant PCM_VOLUME_1Max Kellermann1-1/+6
It may be desirable to change the range of integer volume levels (e.g. to 1024, which may utilize shifts instead of expensive integer divisions). Introduce the constant PCM_VOLUME_1 which describes the integer value for "100% volume". This is currently 1000.
2008-11-11pcm_utils: added inline function pcm_float_to_volume()Max Kellermann1-0/+10
2008-10-31added prefix to header macrosMax Kellermann1-2/+2
"LOG_H" is a macro which is also used by ffmpeg/log.h. This is ffmpeg's fault, because short macros should be reserved for applications, but since it's always a good idea to choose prefixed macro names, even for applications, we are going to do that in MPD.
2008-10-23pcm_utils: moved code to pcm_resample.cMax Kellermann1-14/+2
Separate the resampling code from the rest of pcm_utils.c. Create two sub-libraries: pcm_resample_libsamplerate.c and pcm_resample_fallback.c.
2008-10-23pcm_dither: added generic 24 to 16 bit ditheringMax Kellermann1-0/+4
Copied and adapted code from the mp3 decoder plugin. This library now replaces the old and low-quality function pcm_convert_24_to_16().
2008-10-21pcm_utils: added pcm_convert_init()Max Kellermann1-0/+2
Instead of manually calling memset(0) on the pcm_convert_state struct, client code should use a library function from pcm_utils.c. This way, we can change the semantics of the struct easily.
2008-10-21pcm_utils: no CamelCaseMax Kellermann1-9/+11
Renamed all functions which were still in CamelCase.
2008-10-21pcm_utils: renamed ConvState to struct pcm_convert_stateMax Kellermann1-3/+4
No CamelCase, and a struct instead of a typedef.
2008-09-29pcm_utils: pass only one buffer size to pcm_mix()Max Kellermann1-2/+2
pcm_mix() might overflow the destination buffer if it is smaller than the second buffer. This is ok because the physical buffer size passed by cross_fade_apply() is always big enough, but clutters pcm_mix() with complicated length checks and contains a dangerous buffer overflow pitfall. Simplify pcm_mix()/pcm_add() and pass only the smaller buffer size; let cross_fade_apply() do the memcpy().
2008-09-29assume stdint.h and stddef.h are availableMax Kellermann1-2/+2
Since we use a C99 compiler now, we can assert that the C99 standard headers are available, no need for complicated compile time checks. Kill mpd_types.h.
2008-09-29Switch to C99 types (retaining compat with old compilers)Eric Wong1-3/+3
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-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-7/+9
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-08-26moved struct AudioFormat to audio_format.hMax Kellermann1-1/+1
We want to expose the AudioFormat structure to plugins; remove some clutter by moving its declaration to a separate header file.
2008-04-15more const pointers in pcm_utils.[ch]Max Kellermann1-3/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@7360 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12yet more unsigned integersMax Kellermann1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@7287 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use constant pointers when possibleMax Kellermann1-5/+5
It is a good practice to constify pointers when their dereferenced data is not modified within the functions or its descendants. git-svn-id: https://svn.musicpd.org/mpd/trunk@7234 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-2/+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-11-21A better way to do the last patch (extremely minor patch)Avuton Olrich1-4/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@7042 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-11-21Fix Sun C 5.9 / C99 compatiblityAvuton Olrich1-0/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@7041 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26Make pcm_convertAudioFormat return the buffer size. This is necessaryJ. Alexander Treuman1-3/+3
because lsr may return less than the input buffer size, and the rest of the audio code needs to know the new size. This fixes the clicking that was introduced with recent changes to the lsr code. A huge thanks to remiss for figuring this out. git-svn-id: https://svn.musicpd.org/mpd/trunk@6273 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-24Reverting to the full lsr API. Turns out the simple API needs all of theJ. Alexander Treuman1-2/+20
audio at once, so it won't work for us. The old full API code was still heavily broken, as each call to pcm_convertSampleRate() used the same state, even if it was processing two streams of audio. The new code keeps a separate state for each audio stream that's being converted. git-svn-id: https://svn.musicpd.org/mpd/trunk@6255 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-22Split pcm_convertAudioFormat into separate functions for bitrate, channel,J. Alexander Treuman1-6/+5
and samplerate conversion. This makes the code much easier to read, and fixes a few bugs that were previously there. git-svn-id: https://svn.musicpd.org/mpd/trunk@6224 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-07-26Typo fixAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4470 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-7/+8
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-14[CLEANUP] Remove unused functionAvuton Olrich1-2/+0
Cleanup whitespace->tabs git-svn-id: https://svn.musicpd.org/mpd/trunk@4338 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
2004-11-03remove vim &*(@Warren Dukes1-1/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@2500 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-23configure shout encoding quality and audio formatWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@2307 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-10more little bits of code in prep for resample/audioFormat conversion,Warren Dukes1-4/+6
now to just write the actual audioFormat conversion code! git-svn-id: https://svn.musicpd.org/mpd/trunk@970 09075e82-0dd4-0310-85a5-a0d7c8717e4f