move sound-driver selection code in rdpsnd_init
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1271 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
162bc366b3
commit
6e6853dff8
3
proto.h
3
proto.h
@ -164,8 +164,7 @@ void rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out);
|
|||||||
BOOL rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status);
|
BOOL rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status);
|
||||||
/* rdpsnd.c */
|
/* rdpsnd.c */
|
||||||
void rdpsnd_send_completion(uint16 tick, uint8 packet_index);
|
void rdpsnd_send_completion(uint16 tick, uint8 packet_index);
|
||||||
BOOL rdpsnd_init(void);
|
BOOL rdpsnd_init(char *optarg);
|
||||||
BOOL rdpsnd_select_driver(char *driver, char *options);
|
|
||||||
void rdpsnd_show_help(void);
|
void rdpsnd_show_help(void);
|
||||||
void rdpsnd_play(void);
|
void rdpsnd_play(void);
|
||||||
/* secure.c */
|
/* secure.c */
|
||||||
|
50
rdesktop.c
50
rdesktop.c
@ -408,6 +408,7 @@ main(int argc, char *argv[])
|
|||||||
BOOL geometry_option = False;
|
BOOL geometry_option = False;
|
||||||
int run_count = 0; /* Session Directory support */
|
int run_count = 0; /* Session Directory support */
|
||||||
BOOL continue_connect = True; /* Session Directory support */
|
BOOL continue_connect = True; /* Session Directory support */
|
||||||
|
char *rdpsnd_optarg = NULL;
|
||||||
|
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
/* Set locale according to environment */
|
/* Set locale according to environment */
|
||||||
@ -669,36 +670,9 @@ main(int argc, char *argv[])
|
|||||||
if (str_startswith(optarg, "local"))
|
if (str_startswith(optarg, "local"))
|
||||||
#ifdef WITH_RDPSND
|
#ifdef WITH_RDPSND
|
||||||
{
|
{
|
||||||
char *driver = NULL, *options =
|
rdpsnd_optarg =
|
||||||
NULL;
|
next_arg(optarg, ':');
|
||||||
|
g_rdpsnd = True;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -718,14 +692,7 @@ main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef WITH_RDPSND
|
#ifdef WITH_RDPSND
|
||||||
if (!rdpsnd_select_driver(NULL, NULL))
|
g_rdpsnd = True;
|
||||||
{
|
|
||||||
warning("No sound-driver available\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_rdpsnd = True;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
warning("Not compiled with sound support\n");
|
warning("Not compiled with sound support\n");
|
||||||
#endif
|
#endif
|
||||||
@ -920,7 +887,12 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef WITH_RDPSND
|
#ifdef WITH_RDPSND
|
||||||
if (g_rdpsnd)
|
if (g_rdpsnd)
|
||||||
rdpsnd_init();
|
{
|
||||||
|
if (!rdpsnd_init(rdpsnd_optarg))
|
||||||
|
{
|
||||||
|
warning("Initializing sound-support failed!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (lspci_enabled)
|
if (lspci_enabled)
|
||||||
|
41
rdpsnd.c
41
rdpsnd.c
@ -276,16 +276,6 @@ rdpsnd_process(STREAM s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
|
||||||
rdpsnd_init(void)
|
|
||||||
{
|
|
||||||
rdpsnd_channel =
|
|
||||||
channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
|
|
||||||
rdpsnd_process);
|
|
||||||
|
|
||||||
return (rdpsnd_channel != NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
rdpsnd_auto_open(void)
|
rdpsnd_auto_open(void)
|
||||||
{
|
{
|
||||||
@ -347,12 +337,41 @@ rdpsnd_register_drivers(char *options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
rdpsnd_select_driver(char *driver, char *options)
|
rdpsnd_init(char *optarg)
|
||||||
{
|
{
|
||||||
static struct audio_driver auto_driver;
|
static struct audio_driver auto_driver;
|
||||||
struct audio_driver *pos;
|
struct audio_driver *pos;
|
||||||
|
char *driver = NULL, *options = NULL;
|
||||||
|
|
||||||
drivers = 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);
|
rdpsnd_register_drivers(options);
|
||||||
|
|
||||||
if (!driver)
|
if (!driver)
|
||||||
|
Loading…
Reference in New Issue
Block a user