summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/mpegplayer.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/mpegplayer.h')
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h
index 11bc1ea..b92af38 100644
--- a/apps/plugins/mpegplayer/mpegplayer.h
+++ b/apps/plugins/mpegplayer/mpegplayer.h
@@ -53,18 +53,19 @@ enum mpeg_malloc_reason_t
#define AUDIOBUF_ALLOC_SIZE (AUDIOBUF_SIZE+AUDIOBUF_GUARD_SIZE)
/** PCM buffer **/
-#define CLOCK_RATE 44100 /* Our clock rate in ticks/second (samplerate) */
+#define CLOCK_RATE NATIVE_FREQUENCY /* Our clock rate in ticks/second (samplerate) */
/* Define this as "1" to have a test tone instead of silence clip */
#define SILENCE_TEST_TONE 0
-#define PCMOUT_BUFSIZE (CLOCK_RATE) /* 1s */
-#define PCMOUT_GUARD_SIZE (1152*4 + sizeof (struct pcm_frame_header))
-#define PCMOUT_ALLOC_SIZE (PCMOUT_BUFSIZE + PCMOUT_GUARD_SIZE)
- /* Start pcm playback @ 25% full */
-#define PCMOUT_PLAY_WM (PCMOUT_BUFSIZE/4)
- /* No valid audio frame is smaller */
-#define PCMOUT_LOW_WM (sizeof (struct pcm_frame_header))
+#define PCMOUT_BUFSIZE (CLOCK_RATE/2*4) /* 1/2s */
+#define PCMOUT_GUARD_SAMPLES ((CLOCK_RATE*576+7999)/8000) /* Worst upsampling case */
+#define PCMOUT_GUARD_SIZE (PCMOUT_GUARD_SAMPLES*4 + sizeof (struct pcm_frame_header))
+#define PCMOUT_ALLOC_SIZE (PCMOUT_BUFSIZE + PCMOUT_GUARD_SIZE)
+ /* Start pcm playback @ 25% full */
+#define PCMOUT_PLAY_WM (PCMOUT_BUFSIZE/4)
+ /* No valid audio frame is smaller */
+#define PCMOUT_LOW_WM (sizeof (struct pcm_frame_header))
/** disk buffer **/
#define DISK_BUF_LOW_WATERMARK (1024*1024)