summaryrefslogtreecommitdiffstats
path: root/firmware/pcm_mixer.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-12-05 13:58:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-12-05 13:58:35 +0000
commit906905aa43566c16913238a71ccc13d438af1702 (patch)
treea80373f2495303db1245564bff5a5c66e9449473 /firmware/pcm_mixer.c
parent6461f74ae450ce0c834b3d4c7da134f0fefed945 (diff)
downloadrockbox-906905aa43566c16913238a71ccc13d438af1702.tar.gz
rockbox-906905aa43566c16913238a71ccc13d438af1702.zip
Use a macro for aligning PCM chunks instead of explictly coding it each time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31152 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/pcm_mixer.c')
-rw-r--r--firmware/pcm_mixer.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c
index 817b9a6a3c..25c41c2586 100644
--- a/firmware/pcm_mixer.c
+++ b/firmware/pcm_mixer.c
@@ -70,11 +70,6 @@ static struct mixer_channel * active_channels[PCM_MIXER_NUM_CHANNELS+1] IBSS_ATT
#define MAX_IDLE_FRAMES (NATIVE_FREQUENCY*3 / MIX_FRAME_SAMPLES)
static unsigned int idle_counter = 0;
-/* Cheapo buffer align macro to align to the 16-16 PCM size */
-#define ALIGN_CHANNEL(start, size) \
- ({ start = (void *)(((uintptr_t)start + 3) & ~3); \
- size &= ~3; })
-
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* Include any implemented CPU-optimized mixdown routines */
@@ -244,7 +239,7 @@ fill_frame:
if (chan->get_more)
{
chan->get_more(&chan->start, &chan->size);
- ALIGN_CHANNEL(chan->start, chan->size);
+ ALIGN_AUDIOBUF(chan->start, chan->size);
}
if (!(chan->start && chan->size))
@@ -368,7 +363,7 @@ static void mixer_channel_play_start(struct mixer_channel *chan,
{
pcm_play_unlock(); /* Allow playback while doing any callback */
- ALIGN_CHANNEL(start, size);
+ ALIGN_AUDIOBUF(start, size);
if (!(start && size))
{
@@ -377,7 +372,7 @@ static void mixer_channel_play_start(struct mixer_channel *chan,
if (get_more)
{
get_more(&start, &size);
- ALIGN_CHANNEL(start, size);
+ ALIGN_AUDIOBUF(start, size);
}
}