Commit Graph

6 Commits

Author SHA1 Message Date
Max Kellermann
be9212ba84 audio: moved cmpAudioFormat() to audio_format.h
Rename it to audio_format_equals() and return "true" if they are
equal.
2008-09-09 10:05:15 +02:00
Max Kellermann
dc7c6bd14d pack the struct audio_format
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-07 19:20:01 +02:00
Max Kellermann
f1dd9c209c audio_format: converted typedef AudioFormat to struct audio_format
Get rid of CamelCase, and don't use a typedef, so we can
forward-declare it, and unclutter the include dependencies.
2008-09-07 19:19:55 +02:00
Eric Wong
18fc10a926 audio_format: volatile removal
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-09-07 19:14:50 +02:00
Max Kellermann
2650b9eb31 added inline function audio_format_time_to_size()
Make the code more readable by hiding big formulas in an inline
function with a nice name.
2008-08-26 08:27:09 +02:00
Max Kellermann
1b845f94a0 moved struct AudioFormat to audio_format.h
We want to expose the AudioFormat structure to plugins; remove some
clutter by moving its declaration to a separate header file.
2008-08-26 08:27:06 +02:00