CVS: rdesktop rdpsnd.c,1.30,1.31
Pierre Ossman <[email protected]> Wed, 06 Dec 2006 05:55:37 -0800
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25428
Modified Files:
rdpsnd.c
Log Message:
Add more sensible debug output from rdpsnd.
Index: rdpsnd.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** rdpsnd.c 6 Dec 2006 13:29:41 -0000 1.30
--- rdpsnd.c 6 Dec 2006 13:55:34 -0000 1.31
***************
*** 2,5 ****
--- 2,6 ----
rdesktop: A Remote Desktop Protocol client.
Sound Channel Process Functions
+ Copyright 2006 Pierre Ossman <[email protected]> for Cendio AB
Copyright (C) Matthew Chapman 2003
Copyright (C) GuoJunBo [email protected] 2003
***************
*** 75,83 ****
rdpsnd_send(STREAM s)
{
- #ifdef RDPSND_DEBUG
- printf("RDPSND send:\n");
- hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8);
- #endif
-
channel_send(s, rdpsnd_channel);
}
--- 76,79 ----
***************
*** 94,97 ****
--- 90,96 ----
s_mark_end(s);
rdpsnd_send(s);
+
+ DEBUG_SOUND(("RDPSND: -> RDPSND_COMPLETION(tick: %u, index: %u)\n",
+ (unsigned) tick, (unsigned) packet_index));
}
***************
*** 114,117 ****
--- 113,119 ----
in_uint8s(in, 1); /* padding */
+ DEBUG_SOUND(("RDPSND: RDPSND_NEGOTIATE(formats: %d, pad1: 0x%02x, version: %x)\n",
+ (int) in_format_count, (unsigned) pad1, (unsigned) version));
+
if (current_driver->wave_out_open())
{
***************
*** 180,183 ****
--- 182,188 ----
s_mark_end(out);
+
+ DEBUG_SOUND(("RDPSND: -> RDPSND_NEGOTIATE(formats: %d)\n", (int) format_count));
+
rdpsnd_send(out);
}
***************
*** 191,194 ****
--- 196,201 ----
in_uint16_le(in, tick);
+ DEBUG_SOUND(("RDPSND: RDPSND_PING(tick: 0x%04x)\n", (unsigned) tick));
+
out = rdpsnd_init_packet(RDPSND_PING | 0x2300, 4);
out_uint16_le(out, tick);
***************
*** 196,199 ****
--- 203,208 ----
s_mark_end(out);
rdpsnd_send(out);
+
+ DEBUG_SOUND(("RDPSND: -> (tick: 0x%04x)\n", (unsigned) tick));
}
***************
*** 205,213 ****
static uint8 packet_index;
- #ifdef RDPSND_DEBUG
- printf("RDPSND recv:\n");
- hexdump(s->p, s->end - s->p);
- #endif
-
switch (opcode)
{
--- 214,217 ----
***************
*** 217,220 ****
--- 221,225 ----
in_uint8(s, packet_index);
in_uint8s(s, 3);
+ DEBUG_SOUND(("RDPSND: RDPSND_WRITE(tick: %u, format: %u, index: %u, data: %u bytes)\n", (unsigned) tick, (unsigned) format, (unsigned) packet_index, (unsigned) s->size - 8));
if (format >= MAX_FORMATS)
***************
*** 248,251 ****
--- 253,257 ----
break;
case RDPSND_CLOSE:
+ DEBUG_SOUND(("RDPSND: RDPSND_CLOSE()\n"));
current_driver->wave_out_close();
device_open = False;
***************
*** 260,263 ****
--- 266,270 ----
in_uint16_le(s, vol_left);
in_uint16_le(s, vol_right);
+ DEBUG_SOUND(("RDPSND: RDPSND_VOLUME(left: 0x%04x (%u %%), right: 0x%04x (%u %%))\n", (unsigned) vol_left, (unsigned) vol_left / 655, (unsigned) vol_right, (unsigned) vol_right / 655));
if (device_open)
current_driver->wave_out_volume(vol_left, vol_right);
***************
*** 288,291 ****
--- 295,301 ----
in_uint16_le(s, len);
+ DEBUG_SOUND(("RDPSND: == Opcode %x Length: %d ==\n",
+ (int) packet_opcode, (int) len));
+
packet.p = packet.data;
packet.end = packet.data + len;
***************
*** 303,306 ****
--- 313,318 ----
else if ((packet.p - packet.data) == 12)
{
+ DEBUG_SOUND(("RDPSND: Eating 4 bytes of %d bytes...\n",
+ len));
in_uint8s(s, 4);
len -= 4;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV