summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-15 21:01:27 +0200
committerwm4 <wm4@nowhere>2014-09-15 22:02:04 +0200
commitb951326a38df056b95727e91a4461c0512be7bb3 (patch)
tree9ab8b1a36db8c35a91b914585d13a2d2fa0c815e /osdep
parent9ca1582953bd13838139fc30fb819e9cfce67041 (diff)
downloadmpv-b951326a38df056b95727e91a4461c0512be7bb3.tar.bz2
mpv-b951326a38df056b95727e91a4461c0512be7bb3.tar.xz
ao_oss: remove duplicate audio device open code
The code for reopening the audio device was separate, and duplicated some of the "real" open code. This was very badly done, and major required parts of initialization were skipped. Fix this by removing the code duplication. This consists mainly of moving the code for opening the device to a separate function, and adding some changes to handle format changes gracefully. (We can't change the audio format on the fly, but we can at least not explode and play noise when that happens.) As a minor change, actually always use SNDCTL_DSP_RESET when closing the audio device. We don't want to wait until the rest of the buffer is played. Also, don't use strerror() when printing the error message that reopening failed, simply because reopen_device() takes care of this, and also errno might be clobbered at this point.
Diffstat (limited to 'osdep')
0 files changed, 0 insertions, 0 deletions