summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2014-01-31 19:58:03 -0800
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2014-01-31 19:58:03 -0800
commitc8e36aa91e2122d6119d9d4d66e4c4911993e4f7 (patch)
tree6b4b5e6939640f0e9472d61540e227e838827a5c /sesman
parentb205654e7803edda43cc4c019ec18203b75b91a8 (diff)
parentf14986ec5917b05e23f34d179f761775f2ad08bf (diff)
downloadxrdp-proprietary-c8e36aa91e2122d6119d9d4d66e4c4911993e4f7.tar.gz
xrdp-proprietary-c8e36aa91e2122d6119d9d4d66e4c4911993e4f7.zip
Merge branch 'devel' of github.com:/neutrinolabs/xrdp into devel
Diffstat (limited to 'sesman')
-rw-r--r--sesman/chansrv/sound.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c
index 5669aea8..eb299ecc 100644
--- a/sesman/chansrv/sound.c
+++ b/sesman/chansrv/sound.c
@@ -54,6 +54,7 @@ static struct stream *g_stream_inp = NULL;
char g_buffer[BBUF_SIZE];
int g_buf_index = 0;
int g_sent_time[256];
+int g_sent_flag[256];
#if defined(XRDP_SIMPLESOUND)
static void *DEFAULT_CC
@@ -367,6 +368,16 @@ sound_send_wave_data_chunk(char *data, int data_bytes)
return 0;
}
+ if (g_sent_flag[(g_cBlockNo + 1) & 0xff] & 1)
+ {
+ LOG(10, ("sound_send_wave_data_chunk: no room"));
+ return 0;
+ }
+ else
+ {
+ LOG(10, ("sound_send_wave_data_chunk: got room"));
+ }
+
/* part one of 2 PDU wave info */
LOG(10, ("sound_send_wave_data_chunk: sending %d bytes", data_bytes));
@@ -382,6 +393,7 @@ sound_send_wave_data_chunk(char *data, int data_bytes)
g_cBlockNo++;
out_uint8(s, g_cBlockNo);
g_sent_time[g_cBlockNo & 0xff] = time;
+ g_sent_flag[g_cBlockNo & 0xff] = 1;
LOG(10, ("sound_send_wave_data_chunk: sending time %d, g_cBlockNo %d",
time & 0xffff, g_cBlockNo & 0xff));
@@ -498,7 +510,8 @@ sound_process_wave_confirm(struct stream *s, int size)
time = g_time2();
in_uint16_le(s, wTimeStamp);
in_uint8(s, cConfirmedBlockNo);
- time_diff = time - g_sent_time[cConfirmedBlockNo];
+ time_diff = time - g_sent_time[cConfirmedBlockNo & 0xff];
+ g_sent_flag[cConfirmedBlockNo & 0xff] &= ~1;
LOG(10, ("sound_process_wave_confirm: wTimeStamp %d, "
"cConfirmedBlockNo %d time diff %d",
@@ -637,6 +650,7 @@ sound_init(void)
LOG(0, ("sound_init:"));
+ g_memset(g_sent_flag, 0, sizeof(g_sent_flag));
#ifdef XRDP_LOAD_PULSE_MODULES
if (load_pulse_modules())