summaryrefslogtreecommitdiffstats
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-06-24 20:36:58 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-06-24 20:36:58 +0000
commit3bec38e44255a013bf79a568949c7011360b1868 (patch)
tree1e724ca8f61c629e6c3cabc7e897d963c35249ca /apps/pcmbuf.c
parenta92fc620f0677950d0f5d3e05db914024a015150 (diff)
downloadrockbox-3bec38e44255a013bf79a568949c7011360b1868.tar.gz
rockbox-3bec38e44255a013bf79a568949c7011360b1868.tar.bz2
rockbox-3bec38e44255a013bf79a568949c7011360b1868.zip
SWCODEC: Get rid of unneeded pcm_mute() calls. Leave the only ones that seem to be needed for WM codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13704 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 89f9e27798..7e6954c280 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -37,10 +37,8 @@
#include "dsp.h"
#include "thread.h"
-/* Define PCMBUF_MUTING if the codec requires muting to prevent pops
- * Currently assumes anything other than tlv320 and uda1380 require it
- */
-#if !defined(HAVE_UDA1380) && !defined(HAVE_TLV320)
+/* Define PCMBUF_MUTING if the codec requires muting to prevent pops */
+#if !defined(HAVE_UDA1380) && !defined(HAVE_TLV320) && !defined(HAVE_AS3514)
#define PCMBUF_MUTING
#endif
@@ -363,15 +361,7 @@ bool pcmbuf_crossfade_init(bool manual_skip)
void pcmbuf_play_stop(void)
{
- /** Prevent a very tiny pop from happening by muting audio
- * until dma has been initialized. */
-#ifdef PCMBUF_MUTING
- pcm_mute(true);
-#endif
pcm_play_stop();
-#ifdef PCMBUF_MUTING
- pcm_mute(false);
-#endif
pcmbuf_unplayed_bytes = 0;
pcmbuf_mix_chunk = NULL;
@@ -491,7 +481,8 @@ unsigned char * pcmbuf_get_meminfo(size_t *length)
}
#endif
-void pcmbuf_pause(bool pause) {
+void pcmbuf_pause(bool pause)
+{
#ifdef PCMBUF_MUTING
if (pause)
pcm_mute(true);
@@ -507,26 +498,12 @@ void pcmbuf_pause(bool pause) {
/* Force playback. */
void pcmbuf_play_start(void)
{
- if (!pcm_is_playing() && pcmbuf_unplayed_bytes)
+ if (!pcm_is_playing() && pcmbuf_unplayed_bytes && pcmbuf_read != NULL)
{
-#ifdef PCMBUF_MUTING
- /** Prevent a very tiny pop from happening by muting audio
- * until dma has been initialized. */
- pcm_mute(true);
-#endif
-
- if (pcmbuf_read != NULL)
- {
- last_chunksize = pcmbuf_read->size;
- pcmbuf_unplayed_bytes -= last_chunksize;
- pcm_play_data(pcmbuf_callback,
- (unsigned char *)pcmbuf_read->addr, last_chunksize);
- }
-
-#ifdef PCMBUF_MUTING
- /* Now unmute the audio. */
- pcm_mute(false);
-#endif
+ last_chunksize = pcmbuf_read->size;
+ pcmbuf_unplayed_bytes -= last_chunksize;
+ pcm_play_data(pcmbuf_callback,
+ (unsigned char *)pcmbuf_read->addr, last_chunksize);
}
}