diff options
author | Max Kellermann <max@duempel.org> | 2009-03-10 21:04:45 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-10 21:04:45 +0100 |
commit | f2ec6ee184d3d396cc3689e3d5d0a3a0ecf84c4a (patch) | |
tree | 14afe16ce78ae3ece2dc8cf874c90d0b6c59a4ba /src | |
parent | d3eccb2324050b74fe8d6db0747ffdda035b6075 (diff) | |
download | mpd-f2ec6ee184d3d396cc3689e3d5d0a3a0ecf84c4a.tar.gz mpd-f2ec6ee184d3d396cc3689e3d5d0a3a0ecf84c4a.tar.xz mpd-f2ec6ee184d3d396cc3689e3d5d0a3a0ecf84c4a.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/output_all.c | 8 |
1 files 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(); |