summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/aiff.c9
-rw-r--r--apps/codecs/libpcm/pcm_common.h7
-rw-r--r--apps/codecs/wav.c9
3 files changed, 10 insertions, 15 deletions
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c
index 4b870386c1..fbe814a645 100644
--- a/apps/codecs/aiff.c
+++ b/apps/codecs/aiff.c
@@ -21,7 +21,6 @@
****************************************************************************/
#include "codeclib.h"
-#include <inttypes.h>
#include "codecs/libpcm/support_formats.h"
CODEC_HEADER
@@ -50,7 +49,9 @@ static const struct pcm_entry pcm_codecs[] = {
#define NUM_FORMATS 6
-static int32_t samples[PCM_CHUNK_SIZE] IBSS_ATTR;
+#define PCM_SAMPLE_SIZE (1024*2)
+
+static int32_t samples[PCM_SAMPLE_SIZE] IBSS_ATTR;
static const struct pcm_codec *get_codec(uint32_t formattag)
{
@@ -266,8 +267,8 @@ next_track:
/* check chunksize */
if ((format.chunksize / format.blockalign) * format.samplesperblock * format.channels
- > PCM_CHUNK_SIZE)
- format.chunksize = (PCM_CHUNK_SIZE / format.blockalign) * format.blockalign;
+ > PCM_SAMPLE_SIZE)
+ format.chunksize = (PCM_SAMPLE_SIZE / format.blockalign) * format.blockalign;
if (format.chunksize == 0)
{
DEBUGF("CODEC_ERROR: chunksize is 0\n");
diff --git a/apps/codecs/libpcm/pcm_common.h b/apps/codecs/libpcm/pcm_common.h
index d490a85e9f..7dcacbd19a 100644
--- a/apps/codecs/libpcm/pcm_common.h
+++ b/apps/codecs/libpcm/pcm_common.h
@@ -25,13 +25,6 @@
#include <stdbool.h>
#include <inttypes.h>
-/*
- * PCM_CHUNK_SIZE has the size only of storing the sample at 1/50 seconds.
- * But it might not be 1/50 seconds according to the format.
- * Please confirm the source file of each format.
- */
-#define PCM_CHUNK_SIZE (4096*2)
-
/* Macro that sign extends an unsigned byte */
#define SE(x) ((int32_t)((int8_t)(x)))
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index 293089a737..c2564231c1 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -21,7 +21,6 @@
****************************************************************************/
#include "codeclib.h"
-#include "inttypes.h"
#include "codecs/libpcm/support_formats.h"
CODEC_HEADER
@@ -38,7 +37,9 @@ CODEC_HEADER
*
*/
-static int32_t samples[PCM_CHUNK_SIZE] IBSS_ATTR;
+#define PCM_SAMPLE_SIZE (4096*2)
+
+static int32_t samples[PCM_SAMPLE_SIZE] IBSS_ATTR;
/* This codec support WAVE files with the following formats: */
enum
@@ -350,8 +351,8 @@ next_track:
/* check chunksize */
if ((format.chunksize / format.blockalign) * format.samplesperblock * format.channels
- > PCM_CHUNK_SIZE)
- format.chunksize = (PCM_CHUNK_SIZE / format.blockalign) * format.blockalign;
+ > PCM_SAMPLE_SIZE)
+ format.chunksize = (PCM_SAMPLE_SIZE / format.blockalign) * format.blockalign;
if (format.chunksize == 0)
{
DEBUGF("CODEC_ERROR: chunksize is 0\n");