diff options
author | wm4 <wm4@nowhere> | 2014-09-15 20:40:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-15 21:56:46 +0200 |
commit | 9ca1582953bd13838139fc30fb819e9cfce67041 (patch) | |
tree | ed6d95a6500c63cfc990225069248b2847283713 /audio | |
parent | 2308eda2b8de54003372feb9d3c3a424d97621e7 (diff) | |
download | mpv-9ca1582953bd13838139fc30fb819e9cfce67041.tar.bz2 mpv-9ca1582953bd13838139fc30fb819e9cfce67041.tar.xz |
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_oss.c | 5 |
1 files 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 @@ -487,9 +486,8 @@ 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 |