aboutsummaryrefslogtreecommitdiffstats
path: root/src/dabplus-enc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dabplus-enc.cpp')
-rw-r--r--src/dabplus-enc.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp
index dfca4f1..e9aea14 100644
--- a/src/dabplus-enc.cpp
+++ b/src/dabplus-enc.cpp
@@ -376,7 +376,7 @@ int main(int argc, char *argv[])
}
if (subchannel_index < 1 || subchannel_index > 24) {
- fprintf(stderr, "Bad subchannels number: %d, try other bitrate.\n",
+ fprintf(stderr, "Bad subchannel index: %d, must be between 1 and 24. Try other bitrate.\n",
subchannel_index);
return 1;
}
@@ -534,10 +534,10 @@ int main(int argc, char *argv[])
}
int outbuf_size = subchannel_index*120;
- uint8_t zmqframebuf[2048];
+ uint8_t zmqframebuf[ZMQ_HEADER_SIZE + 24*120];
zmq_frame_header_t *zmq_frame_header = (zmq_frame_header_t*)zmqframebuf;
- uint8_t outbuf[2048];
+ uint8_t outbuf[24*120];
if(outbuf_size % 5 != 0) {
fprintf(stderr, "(outbuf_size mod 5) = %d\n", outbuf_size % 5);
@@ -755,6 +755,8 @@ int main(int argc, char *argv[])
zmq_frame_header->audiolevel_left = peak_left;
zmq_frame_header->audiolevel_right = peak_right;
+ assert(ZMQ_FRAME_SIZE(zmq_frame_header) <= NUMOF(zmqframebuf));
+
memcpy(ZMQ_FRAME_DATA(zmq_frame_header),
outbuf, outbuf_size);