diff options
author | wm4 <wm4@nowhere> | 2013-11-10 23:05:51 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-10 23:05:59 +0100 |
commit | 3cb4116243e54b0452d88c70a7acd4af17cf8d02 (patch) | |
tree | f1e97c8d9f630e81c3e7e7c4022b87952bcfcc15 /audio/out/ao_alsa.c | |
parent | 6ec1f317654ae1e1424ec7c519cf307aae7c3efe (diff) | |
download | mpv-3cb4116243e54b0452d88c70a7acd4af17cf8d02.tar.bz2 mpv-3cb4116243e54b0452d88c70a7acd4af17cf8d02.tar.xz |
ao: add ao_play_silence, use for ao_alsa and ao_oss
Also add a corresponding function to audio/format.c, which fills an
audio block with silence.
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r-- | audio/out/ao_alsa.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index bdfd8fae76..5816ee5f5f 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -78,7 +78,6 @@ struct priv { } while (0) static float get_delay(struct ao *ao); -static int play(struct ao *ao, void *data, int len, int flags); static void uninit(struct ao *ao, bool immed); static void alsa_error_handler(const char *file, int line, const char *function, @@ -612,11 +611,8 @@ static void audio_resume(struct ao *ao) MP_VERBOSE(ao, "resume not supported by hardware\n"); err = snd_pcm_prepare(p->alsa); CHECK_ALSA_ERROR("pcm prepare error"); - if (p->prepause_frames) { - void *silence = calloc(p->prepause_frames, p->bytes_per_sample); - play(ao, silence, p->prepause_frames * p->bytes_per_sample, 0); - free(silence); - } + if (p->prepause_frames) + ao_play_silence(ao, p->prepause_frames); } alsa_error: ; |