mirror of
https://github.com/mpv-player/mpv
synced 2025-01-19 13:51:14 +00:00
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.
This commit is contained in:
parent
2308eda2b8
commit
9ca1582953
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user