aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_format.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2011-03-16audio_format, output_thread: add more audio_format_valid() assertionsMax Kellermann1-0/+6
2010-01-16audio_format: support packed 24 bit samplesMax Kellermann1-0/+9
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-12-02audio_format: changed "bits" to "enum sample_format"Max Kellermann1-19/+67
This patch prepares support for floating point samples (and probably other formats). It changes the meaning of the "bits" attribute from a bit count to a symbolic value.
2009-11-14audio_format: added function audio_format_to_string()Max Kellermann1-0/+19
Unified function for converting an audio_format object to a string, for log messages and for the "status" command.
2009-10-21audio_format: wildcards allowed in audio_format configurationMax Kellermann1-0/+47
An asterisk means that this attribute should not be enforced, and stays whatever it used to be. This way, some configuration values work like masks.
2009-07-23player_thread: don't use precalculated size_to_timeMax Kellermann1-9/+0
Calculate the total play time with the audio_format object each time, using audio_format_time_to_size(). The function audioFormatSizeToTime() is not needed anymore, and will be removed with this patch.
2009-07-22audio_format: added API documentationMax Kellermann1-0/+48
2009-07-22audio_format: initialize reverse_endian in audio_format_init()Max Kellermann1-0/+1
This line was missing in the reverse_endian patch, and led to undefined values and crashes in that attribute.
2009-07-19Add reverse_endian field to struct audio_format and handle conversionDavid Woodhouse1-1/+4
2009-07-19Add audio_format_init() functionDavid Woodhouse1-0/+9
It makes no difference right now, but we're about to add an endianness flag and will want to make sure it's correctly initialised every time.
2009-03-13all: Update copyright header.Avuton Olrich1-6/+7
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-02audio_format: allow 32 bit samplesMax Kellermann1-1/+1
This is the first patch in a series to enable 32 bit audio samples in MPD. 32 bit samples are more tricky than 24 bit samples, because the integer may overflow when you operate on a sample.
2009-03-02audio_format: allow up to 8 channelsMax Kellermann1-1/+1
audio_valid_sample_format() verifies the number of channels. Let's just say up to 8 channels is allowed (which is possible with some consumer sound chips). I don't know if there are bigger cards, and since I cannot test it, I'll limit it to 8 for now.
2009-02-11audio_format: added validation functionsMax Kellermann1-3/+34
In addition to audio_format_valid(), provide functions which validate only one attribute of an audio_format. These functions are reused by audio_format_parse().
2008-11-21audio_format: added audio_format_valid()Max Kellermann1-0/+11
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-10audio_format: added audio_format_frame_size()Max Kellermann1-1/+7
A frame contains one sample per channel, thus it is sample_size * channels. This patch includes some cleanup for various locations where the sample size for 24 bit audio was still 3 bytes (instead of 4).
2008-10-10audio_format: renamed sampleRate to sample_rateMax Kellermann1-5/+5
The last bit of CamelCase in audio_format.h. Additionally, rename a bunch of local variables.
2008-10-10audio_format: unsigned integersMax Kellermann1-2/+2
"bits" and "channels" cannot be negative.
2008-10-08use the "bool" data type instead of "int"Max Kellermann1-3/+4
"bool" should be used in C99 programs for boolean values.
2008-09-29assume stdint.h and stddef.h are availableMax Kellermann1-1/+1
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, part IIMax Kellermann1-3/+3
Do full C99 integer type conversion in all modules which were not touched by Eric's merged patch.
2008-09-23audio_format: added audio_format_sample_size()Max Kellermann1-2/+15
The inline function audio_format_sample_size() calculates how many bytes each sample consumes. This function already takes into account that 24 bit samples are 4 bytes long, not 3.
2008-09-10audio_format: added audio_format_clear() and audio_format_defined()Max Kellermann1-0/+12
audio_format_clear() sets an audio_format struct to an cleared (undefined) state, which is both faster and smaller than memset(0). audio_format_defined() checks if the audio_format struct actually has a defined value (i.e. non-zero). Both can be used to avoid pointers to audio_format, replacing the "NULL" value with an "undefined" audio_format.
2008-09-09audio: moved cmpAudioFormat() to audio_format.hMax Kellermann1-0/+8
Rename it to audio_format_equals() and return "true" if they are equal.
2008-09-07pack the struct audio_formatMax Kellermann1-1/+1
Due to clumsy layout, the audio_format struct took 12 bytes. Move the "channels" to the end, so it can be merged into the same 32 bit slot as "bits", which reduces the struct size to 8 bytes.
2008-09-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-4/+4
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-09-07audio_format: volatile removalEric Wong1-3/+3
volatile provides absolutely no guarantee thread-safety in SMP environments. volatile was designed to access memory locations in peripheral hardware directly; not for SMP. If volatile is needed to work properly on SMP, then it is only hiding subtle bugs. volatile only prevents the /compiler/ from making optimizations when accessing variables. CPUs do their own optimizations at runtime so it cannot guarantee registers of CPUs are flushed to memory cache-coherent access on different CPUs. Furthermore, the thread-communication via condition variables between threads sharing audio formats already results in memory barriers.
2008-08-26added inline function audio_format_time_to_size()Max Kellermann1-0/+5
Make the code more readable by hiding big formulas in an inline function with a nice name.
2008-08-26moved struct AudioFormat to audio_format.hMax Kellermann1-13/+12
We want to expose the AudioFormat structure to plugins; remove some clutter by moving its declaration to a separate header file.
2008-04-12clean up CPP includesMax Kellermann1-1/+0
Try to only include headers which are really needed. We should particularly check all "headers including other headers". The long-term goal is to have a manageable, small API for plugins (decoders, output) without so many mpd internals cluttering the namespace. git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-5/+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-06-01Removing the getBoundPort() function and just making boundPort an extern.J. Alexander Treuman1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@6445 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
2007-01-11Added zeroconf service publishing using avahiJim Ramsay1-0/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@5238 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-20Fix warnings for -Wmissing-prototypesAvuton Olrich1-3/+3
Add -Wmissing-prototypes if compiling with gcc Static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4657 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-1/+1
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-14[CLEANUP] remove unused functionAvuton Olrich1-2/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@4331 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
2005-11-16DJWLindenaar balanced tree and master process patchQball Cow1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@3669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-03-13change some header includes so that we can compile on OS XWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@3067 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-03-06config file change! now 'port' is optional and 'db_file' is required!Warren Dukes1-1/+1
also, should have better error reporting when failing to open playlist or music directory's, or writing the db, etc git-svn-id: https://svn.musicpd.org/mpd/trunk@3027 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-03now one can specify multiple bind_to_addressesWarren Dukes1-3/+13
git-svn-id: https://svn.musicpd.org/mpd/trunk@2501 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-04-14add vim shiznit to end of all source filesWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-03-18bunch of autotool cleanupsWarren Dukes1-0/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@271 09075e82-0dd4-0310-85a5-a0d7c8717e4f