CVS: rdesktop proto.h, 1.95, 1.96 rdesktop.c, 1.151, 1.152 rdpsnd.c, 1.18, 1.19
Michael Gernoth <[email protected]> Thu, 21 Sep 2006 12:00:15 -0700
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30576
Modified Files:
proto.h rdesktop.c rdpsnd.c
Log Message:
move sound-driver selection code in rdpsnd_init
Index: proto.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/proto.h,v
retrieving revision 1.95
retrieving revision 1.96
diff -C2 -d -r1.95 -r1.96
*** proto.h 17 Sep 2006 11:42:22 -0000 1.95
--- proto.h 21 Sep 2006 19:00:11 -0000 1.96
***************
*** 165,170 ****
/* rdpsnd.c */
void rdpsnd_send_completion(uint16 tick, uint8 packet_index);
! BOOL rdpsnd_init(void);
! BOOL rdpsnd_select_driver(char *driver, char *options);
void rdpsnd_show_help(void);
void rdpsnd_play(void);
--- 165,169 ----
/* rdpsnd.c */
void rdpsnd_send_completion(uint16 tick, uint8 packet_index);
! BOOL rdpsnd_init(char *optarg);
void rdpsnd_show_help(void);
void rdpsnd_play(void);
Index: rdesktop.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -C2 -d -r1.151 -r1.152
*** rdesktop.c 18 Sep 2006 21:42:50 -0000 1.151
--- rdesktop.c 21 Sep 2006 19:00:11 -0000 1.152
***************
*** 409,412 ****
--- 409,413 ----
int run_count = 0; /* Session Directory support */
BOOL continue_connect = True; /* Session Directory support */
+ char *rdpsnd_optarg = NULL;
#ifdef HAVE_LOCALE_H
***************
*** 670,703 ****
#ifdef WITH_RDPSND
{
! char *driver = NULL, *options =
! NULL;
!
! if ((driver =
! next_arg(optarg, ':')))
! {
! if (!strlen(driver))
! {
! driver = NULL;
! }
! else if ((options =
! next_arg(driver,
! ':')))
! {
! if (!strlen
! (options))
! options =
! NULL;
! }
! }
!
! if (!rdpsnd_select_driver
! (driver, options))
! {
! warning("Driver not available\n");
! }
! else
! {
! g_rdpsnd = True;
! }
}
--- 671,677 ----
#ifdef WITH_RDPSND
{
! rdpsnd_optarg =
! next_arg(optarg, ':');
! g_rdpsnd = True;
}
***************
*** 719,730 ****
{
#ifdef WITH_RDPSND
! if (!rdpsnd_select_driver(NULL, NULL))
! {
! warning("No sound-driver available\n");
! }
! else
! {
! g_rdpsnd = True;
! }
#else
warning("Not compiled with sound support\n");
--- 693,697 ----
{
#ifdef WITH_RDPSND
! g_rdpsnd = True;
#else
warning("Not compiled with sound support\n");
***************
*** 921,925 ****
#ifdef WITH_RDPSND
if (g_rdpsnd)
! rdpsnd_init();
#endif
--- 888,897 ----
#ifdef WITH_RDPSND
if (g_rdpsnd)
! {
! if (!rdpsnd_init(rdpsnd_optarg))
! {
! warning("Initializing sound-support failed!\n");
! }
! }
#endif
Index: rdpsnd.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** rdpsnd.c 18 Sep 2006 21:42:50 -0000 1.18
--- rdpsnd.c 21 Sep 2006 19:00:11 -0000 1.19
***************
*** 278,291 ****
BOOL
- rdpsnd_init(void)
- {
- rdpsnd_channel =
- channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
- rdpsnd_process);
-
- return (rdpsnd_channel != NULL);
- }
-
- BOOL
rdpsnd_auto_open(void)
{
--- 278,281 ----
***************
*** 348,357 ****
BOOL
! rdpsnd_select_driver(char *driver, char *options)
{
static struct audio_driver auto_driver;
struct audio_driver *pos;
drivers = NULL;
rdpsnd_register_drivers(options);
--- 338,376 ----
BOOL
! rdpsnd_init(char *optarg)
{
static struct audio_driver auto_driver;
struct audio_driver *pos;
+ char *driver = NULL, *options = NULL;
drivers = NULL;
+
+ rdpsnd_channel =
+ channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
+ rdpsnd_process);
+
+ if (rdpsnd_channel == NULL)
+ {
+ error("channel_register\n");
+ return False;
+ }
+
+ if (optarg != NULL && strlen(optarg) > 0)
+ {
+ driver = options = optarg;
+
+ while (*options != '\0' && *options != ':')
+ options++;
+
+ if (*options == ':')
+ {
+ *options = '\0';
+ options++;
+ }
+
+ if (*options == '\0')
+ options = NULL;
+ }
+
rdpsnd_register_drivers(options);
-------------------------------------------------------------------------
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