-ao alsa9:hw:0,0 fix by Wojtek Kaniewski <wojtekka@bydg.pdi.net>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10259 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2003-06-08 04:03:59 +00:00
parent b4545e0ba8
commit ca78cf2743
2 changed files with 14 additions and 6 deletions

View File

@ -317,8 +317,12 @@ static int init(int rate_hz, int channels, int format, int flags)
}
else if (strcmp(*(token_str+i3), "hw") == 0) {
if ((i3 < i2-1) && (strcmp(*(token_str+i3+1), "noblock") != 0) && (strcmp(*(token_str+i3+1), "mmap") != 0)) {
char *tmp;
alsa_device = alloca(ALSA_DEVICE_SIZE);
snprintf(alsa_device, ALSA_DEVICE_SIZE, "hw:%s", *(token_str+(i3+1)));
if ((tmp = strrchr(alsa_device, '.')) && isdigit(*(tmp+1)))
*tmp = ',';
device_set = 1;
}
else {
@ -421,9 +425,9 @@ static int init(int rate_hz, int channels, int format, int flags)
printf("alsa-help: available options are:\n");
printf(" mmap: sets mmap-mode\n");
printf(" noblock: sets noblock-mode\n");
printf(" device-name: sets device name\n");
printf(" example -ao alsa9:mmap:noblock:hw:0,3 sets noblock-mode,\n");
printf(" mmap-mode and the device-name as first card third device\n");
printf(" device-name: sets device name (change comma to point)\n");
printf(" example -ao alsa9:mmap:noblock:hw:0.3 sets noblock-mode,\n");
printf(" mmap-mode and the device-name as first card fourth device\n");
return(0);
} else {
printf("alsa-init: soundcard set to %s\n", alsa_device);

View File

@ -317,8 +317,12 @@ static int init(int rate_hz, int channels, int format, int flags)
}
else if (strcmp(*(token_str+i3), "hw") == 0) {
if ((i3 < i2-1) && (strcmp(*(token_str+i3+1), "noblock") != 0) && (strcmp(*(token_str+i3+1), "mmap") != 0)) {
char *tmp;
alsa_device = alloca(ALSA_DEVICE_SIZE);
snprintf(alsa_device, ALSA_DEVICE_SIZE, "hw:%s", *(token_str+(i3+1)));
if ((tmp = strrchr(alsa_device, '.')) && isdigit(*(tmp+1)))
*tmp = ',';
device_set = 1;
}
else {
@ -421,9 +425,9 @@ static int init(int rate_hz, int channels, int format, int flags)
printf("alsa-help: available options are:\n");
printf(" mmap: sets mmap-mode\n");
printf(" noblock: sets noblock-mode\n");
printf(" device-name: sets device name\n");
printf(" example -ao alsa9:mmap:noblock:hw:0,3 sets noblock-mode,\n");
printf(" mmap-mode and the device-name as first card third device\n");
printf(" device-name: sets device name (change comma to point)\n");
printf(" example -ao alsa9:mmap:noblock:hw:0.3 sets noblock-mode,\n");
printf(" mmap-mode and the device-name as first card fourth device\n");
return(0);
} else {
printf("alsa-init: soundcard set to %s\n", alsa_device);