From ca78cf2743dbe654d6700589760f1d97e11a5654 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 8 Jun 2003 04:03:59 +0000 Subject: [PATCH] -ao alsa9:hw:0,0 fix by Wojtek Kaniewski git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10259 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa1x.c | 10 +++++++--- libao2/ao_alsa9.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libao2/ao_alsa1x.c b/libao2/ao_alsa1x.c index b2e54b48f5..a20e6ce3fe 100644 --- a/libao2/ao_alsa1x.c +++ b/libao2/ao_alsa1x.c @@ -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); diff --git a/libao2/ao_alsa9.c b/libao2/ao_alsa9.c index b2e54b48f5..a20e6ce3fe 100644 --- a/libao2/ao_alsa9.c +++ b/libao2/ao_alsa9.c @@ -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);