CVS: rdesktop rdpsnd.c, 1.42, 1.43 rdpsnd_dsp.h, 1.7, 1.8
Pierre Ossman <[email protected]> Fri, 08 Feb 2008 02:34:55 -0800
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17246
Modified Files:
rdpsnd.c rdpsnd_dsp.h
Log Message:
Make sure to handle big endian systems for the record path as well.
Index: rdpsnd.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** rdpsnd.c 18 Jan 2008 15:11:57 -0000 1.42
--- rdpsnd.c 8 Feb 2008 10:34:52 -0000 1.43
***************
*** 60,63 ****
--- 60,64 ----
static RD_WAVEFORMATEX rec_formats[MAX_FORMATS];
static unsigned int rec_format_count;
+ static unsigned int rec_current_format;
unsigned int queue_hi, queue_lo, queue_pending;
***************
*** 154,158 ****
rdpsnd_record(const void *data, unsigned int size)
{
! uint32 remain;
assert(rec_device_open);
--- 155,159 ----
rdpsnd_record(const void *data, unsigned int size)
{
! uint32 remain, chunk;
assert(rec_device_open);
***************
*** 163,179 ****
if (size >= remain)
! {
! memcpy(record_buffer + record_buffer_size, data, remain);
! record_buffer_size += remain;
! rdpsnd_flush_record();
! data = (const char *) data + remain;
! size -= remain;
! }
else
! {
! memcpy(record_buffer + record_buffer_size, data, size);
! record_buffer_size += size;
! size = 0;
! }
}
}
--- 164,186 ----
if (size >= remain)
! chunk = remain;
else
! chunk = size;
!
! memcpy(record_buffer + record_buffer_size, data, chunk);
!
! #ifdef B_ENDIAN
! if (current_driver->need_byteswap_on_be)
! rdpsnd_dsp_swapbytes(record_buffer + record_buffer_size,
! chunk, &rec_formats[rec_current_format]);
! #endif
!
! record_buffer_size += chunk;
!
! data = (const char *) data + chunk;
! size -= chunk;
!
! if (record_buffer_size == sizeof(record_buffer))
! rdpsnd_flush_record();
}
}
***************
*** 514,517 ****
--- 521,525 ----
break;
}
+ rec_current_format = format;
rec_device_open = True;
break;
Index: rdpsnd_dsp.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_dsp.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rdpsnd_dsp.h 8 Jan 2007 04:47:06 -0000 1.7
--- rdpsnd_dsp.h 8 Feb 2008 10:34:53 -0000 1.8
***************
*** 22,25 ****
--- 22,28 ----
void rdpsnd_dsp_softvol_set(uint16 left, uint16 right);
+ /* Endian conversion */
+ void rdpsnd_dsp_swapbytes(unsigned char *buffer, unsigned int size, RD_WAVEFORMATEX * format);
+
/* Resample control */
RD_BOOL rdpsnd_dsp_resample_set(uint32 device_srate, uint16 device_bitspersample,
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/