audio: replaced copyAudioFormat() with simple assignment

The "!src" check in copyAudioFormat() used to hide bugs - one should
never pass NULL to it.  There is one caller which might pass NULL, add
a check in this caller.

Instead of doing mempcy(), we can simply assign the structures, which
looks more natural.
This commit is contained in:
Max Kellermann
2008-09-09 10:04:42 +02:00
parent f9316fbbbe
commit 7f1cccb3ea
4 changed files with 9 additions and 21 deletions

View File

@@ -103,7 +103,7 @@ int audio_output_init(struct audio_output *ao, ConfigParam * param)
FATAL("error parsing format at line %i\n", bp->line);
}
copyAudioFormat(&ao->outAudioFormat, &ao->reqAudioFormat);
ao->outAudioFormat = ao->reqAudioFormat;
}
if (plugin->init(ao, param) != 0)