aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-10 20:49:35 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-10 20:49:35 +0000
commit33d112499dffd6b5a11639daf01eb31da660a78e (patch)
tree2b725fa70cb285ce8a0b86661262b9b64e8c893c /src
parent76af5b2f90e5a2c7a310d649c6bd36ca08c69dfa (diff)
downloadmpd-33d112499dffd6b5a11639daf01eb31da660a78e.tar.gz
mpd-33d112499dffd6b5a11639daf01eb31da660a78e.tar.xz
mpd-33d112499dffd6b5a11639daf01eb31da660a78e.zip
some debug code
git-svn-id: https://svn.musicpd.org/mpd/trunk@978 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/ogg_decode.c2
-rw-r--r--src/pcm_utils.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/ogg_decode.c b/src/ogg_decode.c
index 10e90a20e..39f3bd89e 100644
--- a/src/ogg_decode.c
+++ b/src/ogg_decode.c
@@ -181,7 +181,7 @@ int ogg_decode(OutputBuffer * cb, DecoderControl * dc)
int current_section;
int eof = 0;
long ret;
-#define OGG_CHUNK_SIZE 2048
+#define OGG_CHUNK_SIZE 64
char chunk[OGG_CHUNK_SIZE];
int chunkpos = 0;
long bitRate = 0;
diff --git a/src/pcm_utils.c b/src/pcm_utils.c
index fcd84bffa..ba387a4b1 100644
--- a/src/pcm_utils.c
+++ b/src/pcm_utils.c
@@ -220,6 +220,7 @@ void pcm_convertAudioFormat(AudioFormat * inFormat, char * inBuffer, size_t
/* only works if outFormat is 16-bit stereo! */
/* resampling code blatantly ripped from XMMS */
const int shift = sizeof(mpd_sint16);
+ int x1 = 0, frac;
mpd_sint32 i, in_samples, out_samples, x, delta;
mpd_sint16 * inptr = (mpd_sint16 *)dataChannelConv;
mpd_sint16 * outptr = (mpd_sint16 *)outBuffer;
@@ -229,11 +230,17 @@ void pcm_convertAudioFormat(AudioFormat * inFormat, char * inBuffer, size_t
nlen <<= shift;
in_samples = dataChannelLen >> shift;
out_samples = nlen >> shift;
- delta = (in_samples << 12) / out_samples;
+ //printf("in_samples=%i out_samples=%i\n",in_samples,out_samples);
+ delta = ((in_samples-1) << 12) / (out_samples-1);
for(x = 0, i = 0; i < out_samples; i++) {
- int x1, frac;
+ //int i1,i2,i3,i4;
x1 = (x >> 12) << 12;
frac = x - x1;
+ /* i1 = (x1 >> 12) << 1;
+ i2 = ((x1 >> 12) + 1) << 1;
+ i3 = ((x1 >> 12) << 1) + 1;
+ i4 = (((x1 >> 12) + 1) << 1) + 1;
+ printf("%i,%i,%i,%i\n",i1,i2,i3,i4);*/
*outptr++ =
((inptr[(x1 >> 12) << 1] *
((1<<12) - frac) +