From f2ec6ee184d3d396cc3689e3d5d0a3a0ecf84c4a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Mar 2009 21:04:45 +0100 Subject: [PATCH] output_all: don't allow audio_format==NULL in audio_output_all_open() Don't allow reopening an audio device after pause with audio_format==NULL, force the caller to provide the audio_format each time. --- src/output_all.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/output_all.c b/src/output_all.c index c1353fa71..3bbf4a933 100644 --- a/src/output_all.c +++ b/src/output_all.c @@ -232,6 +232,7 @@ audio_output_all_open(const struct audio_format *audio_format, bool ret = false, enabled = false; unsigned int i; + assert(audio_format != NULL); assert(buffer != NULL); assert(g_music_buffer == NULL || g_music_buffer == buffer); assert((g_mp == NULL) == (g_music_buffer == NULL)); @@ -240,8 +241,7 @@ audio_output_all_open(const struct audio_format *audio_format, /* the audio format must be the same as existing chunks in the pipe */ - assert(audio_format == NULL || g_mp == NULL || - music_pipe_check_format(g_mp, audio_format)); + assert(g_mp == NULL || music_pipe_check_format(g_mp, audio_format)); if (g_mp == NULL) g_mp = music_pipe_new(); @@ -249,12 +249,10 @@ audio_output_all_open(const struct audio_format *audio_format, /* if the pipe hasn't been cleared, the the audio format must not have changed */ assert(music_pipe_size(g_mp) == 0 || - audio_format == NULL || audio_format_equals(audio_format, &input_audio_format)); - if (audio_format != NULL) - input_audio_format = *audio_format; + input_audio_format = *audio_format; audio_output_all_reset_reopen(); audio_output_all_update();