aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-09 12:54:59 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-09 12:54:59 +0100
commit6971dbeba89788773caeffc863ebe3bc5fd652f6 (patch)
tree0edf69b1bea9e632ebc9b8122b88ed0eaca278b6
parent7214f2c1e9c3a0f4fbebe39376f5a0d646cf8bb7 (diff)
downloadfdk-aac-dabplus-6971dbeba89788773caeffc863ebe3bc5fd652f6.tar.gz
fdk-aac-dabplus-6971dbeba89788773caeffc863ebe3bc5fd652f6.tar.bz2
fdk-aac-dabplus-6971dbeba89788773caeffc863ebe3bc5fd652f6.zip
Fix alsa-dabplus-zmq.c buffer sizes
-rw-r--r--aac-enc-dabplus.c1
-rw-r--r--alsa-dabplus-zmq.c14
2 files changed, 4 insertions, 11 deletions
diff --git a/aac-enc-dabplus.c b/aac-enc-dabplus.c
index cd86053..6a0b882 100644
--- a/aac-enc-dabplus.c
+++ b/aac-enc-dabplus.c
@@ -333,6 +333,7 @@ int main(int argc, char *argv[]) {
}
} else {
read = wav_read_data(wav, input_buf, input_size);
+ // returns bytes read
}
for (i = 0; i < read/2; i++) {
diff --git a/alsa-dabplus-zmq.c b/alsa-dabplus-zmq.c
index efe66c1..abd4768 100644
--- a/alsa-dabplus-zmq.c
+++ b/alsa-dabplus-zmq.c
@@ -410,22 +410,14 @@ int main(int argc, char *argv[]) {
break;
}
- readframes*=2;
-#if 1
- for (i = 0; i < readframes; i++) {
- const uint8_t* in = &input_buf[2*i];
- convert_buf[i] = in[0] | (in[1] << 8);
- }
-#endif
-
if (readframes <= 0) {
in_args.numInSamples = -1;
} else {
in_ptr = input_buf;
- in_size = readframes*2;
- in_elem_size = 2;
+ in_size = readframes*bytes_per_sample*channels;
+ in_elem_size = bytes_per_sample;
- in_args.numInSamples = readframes;
+ in_args.numInSamples = readframes*bytes_per_sample;
in_buf.numBufs = 1;
in_buf.bufs = &in_ptr;
in_buf.bufferIdentifiers = &in_identifier;