output: removed audio_output.convertAudioFormat
Instead of checking convertAudioFormat, we can simply check if reqAudioFormat is defined. This saves 4 bytes in the struct.
This commit is contained in:
@@ -60,7 +60,6 @@ struct audio_output {
|
|||||||
|
|
||||||
const struct audio_output_plugin *plugin;
|
const struct audio_output_plugin *plugin;
|
||||||
|
|
||||||
int convertAudioFormat;
|
|
||||||
struct audio_format inAudioFormat;
|
struct audio_format inAudioFormat;
|
||||||
struct audio_format outAudioFormat;
|
struct audio_format outAudioFormat;
|
||||||
struct audio_format reqAudioFormat;
|
struct audio_format reqAudioFormat;
|
||||||
|
@@ -33,7 +33,7 @@ int audio_output_open(struct audio_output *audioOutput,
|
|||||||
|
|
||||||
audioOutput->inAudioFormat = *audioFormat;
|
audioOutput->inAudioFormat = *audioFormat;
|
||||||
|
|
||||||
if (audioOutput->convertAudioFormat) {
|
if (audio_format_defined(&audioOutput->reqAudioFormat)) {
|
||||||
audioOutput->outAudioFormat = audioOutput->reqAudioFormat;
|
audioOutput->outAudioFormat = audioOutput->reqAudioFormat;
|
||||||
} else {
|
} else {
|
||||||
audioOutput->outAudioFormat = audioOutput->inAudioFormat;
|
audioOutput->outAudioFormat = audioOutput->inAudioFormat;
|
||||||
|
@@ -86,25 +86,22 @@ int audio_output_init(struct audio_output *ao, ConfigParam * param)
|
|||||||
ao->plugin = plugin;
|
ao->plugin = plugin;
|
||||||
ao->open = 0;
|
ao->open = 0;
|
||||||
|
|
||||||
ao->convertAudioFormat = 0;
|
|
||||||
ao->sameInAndOutFormats = 0;
|
ao->sameInAndOutFormats = 0;
|
||||||
ao->convBuffer = NULL;
|
ao->convBuffer = NULL;
|
||||||
ao->convBufferLen = 0;
|
ao->convBufferLen = 0;
|
||||||
|
|
||||||
memset(&ao->inAudioFormat, 0, sizeof(ao->inAudioFormat));
|
memset(&ao->inAudioFormat, 0, sizeof(ao->inAudioFormat));
|
||||||
memset(&ao->outAudioFormat, 0, sizeof(ao->outAudioFormat));
|
memset(&ao->outAudioFormat, 0, sizeof(ao->outAudioFormat));
|
||||||
memset(&ao->reqAudioFormat, 0, sizeof(ao->reqAudioFormat));
|
|
||||||
memset(&ao->convState, 0, sizeof(ConvState));
|
memset(&ao->convState, 0, sizeof(ConvState));
|
||||||
|
|
||||||
if (format) {
|
if (format) {
|
||||||
ao->convertAudioFormat = 1;
|
|
||||||
|
|
||||||
if (0 != parseAudioConfig(&ao->reqAudioFormat, format)) {
|
if (0 != parseAudioConfig(&ao->reqAudioFormat, format)) {
|
||||||
FATAL("error parsing format at line %i\n", bp->line);
|
FATAL("error parsing format at line %i\n", bp->line);
|
||||||
}
|
}
|
||||||
|
|
||||||
ao->outAudioFormat = ao->reqAudioFormat;
|
ao->outAudioFormat = ao->reqAudioFormat;
|
||||||
}
|
} else
|
||||||
|
audio_format_clear(&ao->reqAudioFormat);
|
||||||
|
|
||||||
if (plugin->init(ao, param) != 0)
|
if (plugin->init(ao, param) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user