summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-06-30 23:37:41 +0000
committerwm4 <wm4@nowhere>2013-09-23 01:21:37 +0200
commit20b2d7cb6fcc2190daf46d1dd24cd9649756605d (patch)
treef02d90bdfd25f8e35dbbda82f6a756a9afeeb32e /audio
parentcc7f8ee6204ffbeac195623a6be59ab9bcc32622 (diff)
downloadmpv-20b2d7cb6fcc2190daf46d1dd24cd9649756605d.tar.bz2
mpv-20b2d7cb6fcc2190daf46d1dd24cd9649756605d.tar.xz
ao_oss: add support for SNDCTL_DSP_RESET and use it when pausing
Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_oss.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c
index 0890f11e0a..5050f9771f 100644
--- a/audio/out/ao_oss.c
+++ b/audio/out/ao_oss.c
@@ -476,7 +476,11 @@ static void audio_pause(struct ao *ao)
{
struct priv *p = ao->priv;
p->prepause_space = get_space(ao);
+#ifdef SNDCTL_DSP_RESET
+ ioctl(p->audio_fd, SNDCTL_DSP_RESET, NULL);
+#else
close_device(ao);
+#endif
}
// plays 'len' bytes of 'data'
@@ -500,7 +504,9 @@ static void audio_resume(struct ao *ao)
{
struct priv *p = ao->priv;
int fillcnt;
+#ifndef SNDCTL_DSP_RESET
reset(ao);
+#endif
fillcnt = get_space(ao) - p->prepause_space;
if (fillcnt > 0 && !(ao->format & AF_FORMAT_SPECIAL_MASK)) {
void *silence = calloc(fillcnt, 1);