mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
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>
This commit is contained in:
parent
cc7f8ee620
commit
20b2d7cb6f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user