summaryrefslogtreecommitdiff
path: root/src/audio/manager.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-06-01 18:39:20 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2023-06-01 18:39:20 -0400
commit0f3814586e3949d1a7fc15bfc2aff2b99d4975a8 (patch)
tree14f9155741f3ec0bb72019cec459be9912cbcdee /src/audio/manager.cpp
parent5a902f862c92206092d558a401e6e6ad3813cc31 (diff)
parentf1fb2419d671b1277c2214e645faad6d7a4fded1 (diff)
downloadabaddon-portaudio-0f3814586e3949d1a7fc15bfc2aff2b99d4975a8.tar.gz
abaddon-portaudio-0f3814586e3949d1a7fc15bfc2aff2b99d4975a8.zip
Merge branch 'master' into rnnoise
Diffstat (limited to 'src/audio/manager.cpp')
-rw-r--r--src/audio/manager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/audio/manager.cpp b/src/audio/manager.cpp
index 9aacd29..3a24079 100644
--- a/src/audio/manager.cpp
+++ b/src/audio/manager.cpp
@@ -50,6 +50,15 @@ void capture_data_callback(ma_device *pDevice, void *pOutput, const void *pInput
if (mgr == nullptr) return;
mgr->OnCapturedPCM(static_cast<const int16_t *>(pInput), frameCount);
+
+ /*
+ * You can simply increment it by 480 in UDPSocket::SendEncrypted but this is wrong
+ * The timestamp is supposed to be strictly linear eg. if there's discontinuous
+ * transmission for 1 second then the timestamp should be 48000 greater than the
+ * last packet. So it's incremented here because this is fired 100x per second
+ * and is always called in sync with UDPSocket::SendEncrypted
+ */
+ mgr->m_rtp_timestamp += 480;
}
AudioManager::AudioManager() {
@@ -484,6 +493,10 @@ AudioDevices &AudioManager::GetDevices() {
return m_devices;
}
+uint32_t AudioManager::GetRTPTimestamp() const noexcept {
+ return m_rtp_timestamp;
+}
+
AudioManager::type_signal_opus_packet AudioManager::signal_opus_packet() {
return m_signal_opus_packet;
}