aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-07-31 12:17:16 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-07-31 12:17:16 +0200
commit423cd09abe52c754c333fdf8df0f4bf9623ff97b (patch)
treee3967ca7a280dbf1e60256298dab74bcb9ead8d9 /src
parent7a50aff45d650e6bd143e52c58bc38221df1f43a (diff)
downloadODR-AudioEnc-423cd09abe52c754c333fdf8df0f4bf9623ff97b.tar.gz
ODR-AudioEnc-423cd09abe52c754c333fdf8df0f4bf9623ff97b.tar.bz2
ODR-AudioEnc-423cd09abe52c754c333fdf8df0f4bf9623ff97b.zip
Fix audio level metadata insertion
Diffstat (limited to 'src')
-rw-r--r--src/odr-audioenc.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp
index 0c7c9c3..6a5f6ea 100644
--- a/src/odr-audioenc.cpp
+++ b/src/odr-audioenc.cpp
@@ -482,7 +482,7 @@ public:
~AudioEnc();
int run();
- bool send_frame(const uint8_t *buf, size_t len);
+ bool send_frame(const uint8_t *buf, size_t len, int peak_left, int peak_right);
shared_ptr<InputInterface> initialise_input();
};
@@ -1140,7 +1140,7 @@ int AudioEnc::run()
std::copy(toolame_buffer.begin(), toolame_buffer.begin() + frame_len, frame.begin());
toolame_buffer.erase(toolame_buffer.begin(), toolame_buffer.begin() + frame_len);
- bool success = send_frame(frame.data(), frame.size());
+ bool success = send_frame(frame.data(), frame.size(), peak_left, peak_right);
if (not success) {
fprintf(stderr, "Send error !\n");
send_error_count ++;
@@ -1148,7 +1148,7 @@ int AudioEnc::run()
}
}
else if (numOutBytes > 0 and selected_encoder == encoder_selection_t::fdk_dabplus) {
- bool success = send_frame(outbuf.data(), numOutBytes);
+ bool success = send_frame(outbuf.data(), numOutBytes, peak_left, peak_right);
if (not success) {
fprintf(stderr, "Send error !\n");
send_error_count ++;
@@ -1206,15 +1206,18 @@ int AudioEnc::run()
return retval;
}
-bool AudioEnc::send_frame(const uint8_t *buf, size_t len)
+bool AudioEnc::send_frame(const uint8_t *buf, size_t len, int peak_left, int peak_right)
{
if (file_output) {
+ file_output->update_audio_levels(peak_left, peak_right);
return file_output->write_frame(buf, len);
}
else if (zmq_output) {
+ zmq_output->update_audio_levels(peak_left, peak_right);
return zmq_output->write_frame(buf, len);
}
else if (edi_output.enabled()) {
+ edi_output.update_audio_levels(peak_left, peak_right);
switch (selected_encoder) {
case encoder_selection_t::fdk_dabplus:
{