aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-11 07:48:30 +0200
committerMax Kellermann <max@duempel.org>2008-09-11 07:48:30 +0200
commit3aa4564b561f0afd8eae1eeee7836006baffcde8 (patch)
tree1d4208fb57b9840a8a90f418a0d7b21fc3f085c0
parent56cf54e880359d40dae7df460b23101a4f1a77fb (diff)
downloadmpd-3aa4564b561f0afd8eae1eeee7836006baffcde8.tar.gz
mpd-3aa4564b561f0afd8eae1eeee7836006baffcde8.tar.xz
mpd-3aa4564b561f0afd8eae1eeee7836006baffcde8.zip
output: removed audio_output.sameInAndOutFormats
Eliminate sameInAndOutFormats and check with audio_format_equals() each time it this information is needed. Another 4 bytes saved.
-rw-r--r--src/output_api.h1
-rw-r--r--src/output_control.c8
-rw-r--r--src/output_init.c1
3 files changed, 2 insertions, 8 deletions
diff --git a/src/output_api.h b/src/output_api.h
index d59fa8424..887b57c7c 100644
--- a/src/output_api.h
+++ b/src/output_api.h
@@ -66,7 +66,6 @@ struct audio_output {
ConvState convState;
char *convBuffer;
size_t convBufferLen;
- int sameInAndOutFormats;
void *data;
};
diff --git a/src/output_control.c b/src/output_control.c
index 7e181aca2..26558d3c4 100644
--- a/src/output_control.c
+++ b/src/output_control.c
@@ -44,10 +44,6 @@ int audio_output_open(struct audio_output *audioOutput,
if (!audioOutput->open)
ret = audioOutput->plugin->open(audioOutput);
- audioOutput->sameInAndOutFormats =
- audio_format_equals(&audioOutput->inAudioFormat,
- &audioOutput->outAudioFormat);
-
return ret;
}
@@ -82,9 +78,9 @@ int audio_output_play(struct audio_output *audioOutput,
if (!audioOutput->open)
return -1;
- if (!audioOutput->sameInAndOutFormats) {
+ if (!audio_format_equals(&audioOutput->inAudioFormat,
+ &audioOutput->outAudioFormat))
convertAudioFormat(audioOutput, &playChunk, &size);
- }
ret = audioOutput->plugin->play(audioOutput, playChunk, size);
diff --git a/src/output_init.c b/src/output_init.c
index 0a91565c8..00226f7d8 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -86,7 +86,6 @@ int audio_output_init(struct audio_output *ao, ConfigParam * param)
ao->plugin = plugin;
ao->open = 0;
- ao->sameInAndOutFormats = 0;
ao->convBuffer = NULL;
ao->convBufferLen = 0;