From 9ca1582953bd13838139fc30fb819e9cfce67041 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 15 Sep 2014 20:40:30 +0200 Subject: ao_oss: assume audio format reinit is not needed with SNDCTL_DSP_RESET I have no idea whether this is true, because there literally doesn't seem to exist documentation for SNDCTL_DSP_RESET. But at least on Linux' OSS emulation, it is true. Also, it would be quite insane if it would be needed. --- audio/out/ao_oss.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 28582b2d85..a2d2243ebd 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -472,7 +472,6 @@ static void close_device(struct ao *ao) static void reset(struct ao *ao) { struct priv *p = ao->priv; - int oss_format; #if KEEP_DEVICE ioctl(p->audio_fd, SNDCTL_DSP_RESET, NULL); #else @@ -486,10 +485,9 @@ static void reset(struct ao *ao) #if defined(FD_CLOEXEC) && defined(F_SETFD) fcntl(p->audio_fd, F_SETFD, FD_CLOEXEC); -#endif #endif - oss_format = format2oss(ao->format); + int oss_format = format2oss(ao->format); if (AF_FORMAT_IS_AC3(ao->format)) ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &ao->samplerate); ioctl(p->audio_fd, SNDCTL_DSP_SETFMT, &oss_format); @@ -503,6 +501,7 @@ static void reset(struct ao *ao) } ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &ao->samplerate); } +#endif } // return: how many samples can be played without blocking -- cgit v1.2.3