aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:06 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:06 +0200
commit2e9169de9d859fd5d5629a4d1b3789155a5dac62 (patch)
tree3c4db7795105ebbd9651fd946b047bf642fc2590 /src
parent1b845f94a0a75bd6cc21ac666c9c0ab04362dd80 (diff)
downloadmpd-2e9169de9d859fd5d5629a4d1b3789155a5dac62.tar.gz
mpd-2e9169de9d859fd5d5629a4d1b3789155a5dac62.tar.xz
mpd-2e9169de9d859fd5d5629a4d1b3789155a5dac62.zip
moved convState to struct decoder
Since we moved all PCM conversions to decoder_data(), the attribute convState isn't being used anymore by the OutputBuffer code. Move it to struct decoder.
Diffstat (limited to 'src')
-rw-r--r--src/decoder_api.c10
-rw-r--r--src/decoder_internal.h3
-rw-r--r--src/outputBuffer.c1
-rw-r--r--src/outputBuffer.h3
4 files changed, 10 insertions, 7 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 2d79ab66b..7fab6678a 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "decoder_api.h"
+#include "decoder_internal.h"
#include "audio.h"
#include "utils.h"
@@ -25,12 +25,14 @@
#include "playerData.h"
#include "gcc.h"
-void decoder_initialized(mpd_unused struct decoder * decoder,
+void decoder_initialized(struct decoder * decoder,
const AudioFormat * audio_format,
float total_time)
{
assert(dc.state == DECODE_STATE_START);
+ memset(&decoder->conv_state, 0, sizeof(decoder->conv_state));
+
if (audio_format != NULL) {
dc.audioFormat = *audio_format;
getOutputAudioFormat(audio_format,
@@ -70,7 +72,7 @@ static int need_chunks(InputStream * inStream, int seekable)
return 0;
}
-int decoder_data(mpd_unused struct decoder *decoder, InputStream * inStream,
+int decoder_data(struct decoder *decoder, InputStream * inStream,
int seekable,
void *dataIn, size_t dataInLen,
float data_time, mpd_uint16 bitRate,
@@ -98,7 +100,7 @@ int decoder_data(mpd_unused struct decoder *decoder, InputStream * inStream,
data = convBuffer;
datalen = pcm_convertAudioFormat(&(dc.audioFormat), dataIn,
dataInLen, &(ob.audioFormat),
- data, &(ob.convState));
+ data, &decoder->conv_state);
}
if (replayGainInfo != NULL && (replayGainState != REPLAYGAIN_OFF))
diff --git a/src/decoder_internal.h b/src/decoder_internal.h
index 7f1095db9..2115990a8 100644
--- a/src/decoder_internal.h
+++ b/src/decoder_internal.h
@@ -20,9 +20,12 @@
#define DECODER_INTERNAL_H
#include "decoder_api.h"
+#include "pcm_utils.h"
struct decoder {
InputPlugin *plugin;
+
+ ConvState conv_state;
};
#endif
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index fc19dbc5e..e500e6860 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -25,7 +25,6 @@ void ob_init(unsigned int size, Notify *notify)
{
assert(size > 0);
- memset(&ob.convState, 0, sizeof(ConvState));
ob.chunks = xmalloc(size * sizeof(*ob.chunks));
ob.size = size;
ob.begin = 0;
diff --git a/src/outputBuffer.h b/src/outputBuffer.h
index fb3b4302d..67bb0937e 100644
--- a/src/outputBuffer.h
+++ b/src/outputBuffer.h
@@ -20,7 +20,7 @@
#define OUTPUT_BUFFER_H
#include "notify.h"
-#include "pcm_utils.h"
+#include "audio_format.h"
#define OUTPUT_BUFFER_DC_STOP -1
#define OUTPUT_BUFFER_DC_SEEK -2
@@ -55,7 +55,6 @@ typedef struct _OutputBuffer {
int lazy;
AudioFormat audioFormat;
- ConvState convState;
Notify *notify;
} OutputBuffer;