From 0f66a7cbf7a430cf4cc15b85f9766008079d649b Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Fri, 15 Feb 2013 12:14:58 +0330 Subject: [PATCH] minmad: open oss device O_WRONLY and set rate after channels This follows OSS guidelines. --- minmad.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/minmad.c b/minmad.c index 671cbde..5e51b5b 100644 --- a/minmad.c +++ b/minmad.c @@ -1,9 +1,9 @@ /* * minmad - a minimal mp3 player using libmad and oss * - * Copyright (C) 2009-2011 Ali Gholami Rudi + * Copyright (C) 2009-2013 Ali Gholami Rudi * - * This program is released under GNU GPL version 2. + * This program is released under the modified BSD license. */ #include #include @@ -181,9 +181,9 @@ static void oss_conf(void) { int ch = 2; int bits = 16; - ioctl(afd, SOUND_PCM_WRITE_RATE, &rate); ioctl(afd, SOUND_PCM_WRITE_CHANNELS, &ch); ioctl(afd, SOUND_PCM_WRITE_BITS, &bits); + ioctl(afd, SOUND_PCM_WRITE_RATE, &rate); } static char mixed[1 << 20]; @@ -238,7 +238,7 @@ static void decode(void) static void oss_init(void) { - afd = open("/dev/dsp", O_RDWR); + afd = open("/dev/dsp", O_WRONLY); if (afd < 0) { fprintf(stderr, "cannot open /dev/dsp\n"); exit(1); -- 2.11.4.GIT