output: removed audio_output.sameInAndOutFormats
Eliminate sameInAndOutFormats and check with audio_format_equals() each time it this information is needed. Another 4 bytes saved.
This commit is contained in:
parent
56cf54e880
commit
3aa4564b56
@ -66,7 +66,6 @@ struct audio_output {
|
|||||||
ConvState convState;
|
ConvState convState;
|
||||||
char *convBuffer;
|
char *convBuffer;
|
||||||
size_t convBufferLen;
|
size_t convBufferLen;
|
||||||
int sameInAndOutFormats;
|
|
||||||
|
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
@ -44,10 +44,6 @@ int audio_output_open(struct audio_output *audioOutput,
|
|||||||
if (!audioOutput->open)
|
if (!audioOutput->open)
|
||||||
ret = audioOutput->plugin->open(audioOutput);
|
ret = audioOutput->plugin->open(audioOutput);
|
||||||
|
|
||||||
audioOutput->sameInAndOutFormats =
|
|
||||||
audio_format_equals(&audioOutput->inAudioFormat,
|
|
||||||
&audioOutput->outAudioFormat);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,9 +78,9 @@ int audio_output_play(struct audio_output *audioOutput,
|
|||||||
if (!audioOutput->open)
|
if (!audioOutput->open)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!audioOutput->sameInAndOutFormats) {
|
if (!audio_format_equals(&audioOutput->inAudioFormat,
|
||||||
|
&audioOutput->outAudioFormat))
|
||||||
convertAudioFormat(audioOutput, &playChunk, &size);
|
convertAudioFormat(audioOutput, &playChunk, &size);
|
||||||
}
|
|
||||||
|
|
||||||
ret = audioOutput->plugin->play(audioOutput, playChunk, size);
|
ret = audioOutput->plugin->play(audioOutput, playChunk, size);
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ int audio_output_init(struct audio_output *ao, ConfigParam * param)
|
|||||||
ao->plugin = plugin;
|
ao->plugin = plugin;
|
||||||
ao->open = 0;
|
ao->open = 0;
|
||||||
|
|
||||||
ao->sameInAndOutFormats = 0;
|
|
||||||
ao->convBuffer = NULL;
|
ao->convBuffer = NULL;
|
||||||
ao->convBufferLen = 0;
|
ao->convBufferLen = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user