mike-jumper commented on a change in pull request #312:
URL: https://github.com/apache/guacamole-server/pull/312#discussion_r532805321



##########
File path: src/protocols/rdp/channels/audio-input/audio-buffer.c
##########
@@ -131,6 +137,19 @@ void guac_rdp_audio_buffer_begin(guac_rdp_audio_buffer* 
audio_buffer,
                               * audio_buffer->out_format.channels
                               * audio_buffer->out_format.bps;
 
+    /* Calculate the interval to send each packet in ms.
+     * We need to set half of the time duration designated
+     * by packet frames according to Nyquist's theorem.
+     */
+    audio_buffer->packet_interval = packet_frames
+                                  * 1000
+                                  / audio_buffer->out_format.rate
+                                  / 2;

Review comment:
       Sure. That being the case:
   
   * That would be the reasoning to cite here, not Nyquist's theorem.
   * This sounds like a workaround for a problem that results from not properly 
calculating the send interval in the first place. Rather than use a constant 
interval, falling back to a hard-coded 5ms if the interval is sufficiently 
small, shouldn't the interval be determined dynamically based on (1) how much 
time has elapsed since the last time a packet was sent and (2) how much audio 
data is about to be sent?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to