diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-04-25 15:12:24 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-04-25 15:12:24 +0200 |
commit | 8f13b3f2580f182f51d9ad131da1deafdcd5e91a (patch) | |
tree | 57e308cc985a0d96a20c37d48b1c3a2dd4ad245d /src/dabplus-enc-file-zmq.c | |
parent | 8fadb4940c9fcbde6a00b2b78badfcb1269382ba (diff) | |
download | ODR-AudioEnc-8f13b3f2580f182f51d9ad131da1deafdcd5e91a.tar.gz ODR-AudioEnc-8f13b3f2580f182f51d9ad131da1deafdcd5e91a.tar.bz2 ODR-AudioEnc-8f13b3f2580f182f51d9ad131da1deafdcd5e91a.zip |
use new message format for file encoder too
Diffstat (limited to 'src/dabplus-enc-file-zmq.c')
-rw-r--r-- | src/dabplus-enc-file-zmq.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/dabplus-enc-file-zmq.c b/src/dabplus-enc-file-zmq.c index 106e110..1bfae12 100644 --- a/src/dabplus-enc-file-zmq.c +++ b/src/dabplus-enc-file-zmq.c @@ -412,9 +412,12 @@ int main(int argc, char *argv[]) { return 0; } - int loops = 0; int outbuf_size = subchannel_index*120; - uint8_t outbuf[20480]; + uint8_t zmqframebuf[2048]; + struct zmq_frame_header_t *zmq_frame_header = + (struct zmq_frame_header_t*)zmqframebuf; + + uint8_t outbuf[2048]; if(outbuf_size % 5 != 0) { fprintf(stderr, "(outbuf_size mod 5) = %d\n", outbuf_size % 5); @@ -554,7 +557,17 @@ int main(int argc, char *argv[]) { } if (zmq_sock) { - send_error = zmq_send(zmq_sock, outbuf, outbuf_size, ZMQ_DONTWAIT); + zmq_frame_header->version = 1; + zmq_frame_header->encoder = ZMQ_ENCODER_FDK; + zmq_frame_header->datasize = outbuf_size; + zmq_frame_header->audiolevel_left = peak_left; + zmq_frame_header->audiolevel_right = peak_right; + + memcpy(ZMQ_FRAME_DATA(zmq_frame_header), + outbuf, outbuf_size); + + send_error = zmq_send(zmq_sock, zmqframebuf, + ZMQ_FRAME_SIZE(zmq_frame_header), ZMQ_DONTWAIT); if (send_error < 0) { fprintf(stderr, "ZeroMQ send failed! %s\n", zmq_strerror(errno)); send_error_count ++; |