From a748ea5a55f4f5d9f9d58b0e6c7667d61cfde501 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Sep 2008 23:59:55 +0200 Subject: flac: merged flacSendChunk() into flac_common_write() Since flacSendChunk() is a trivial function and is only used in one location, move the code there. The advantage is that calling decoder_data() directly returns the decoder_command value, so we can eliminate one decoder_get_command() call. [ew: using the terser API in the main branch, it always eliminated the dc_intr()/dc_seek() call, but I agree that killing a camel, err.. camelCase function is a good thing] --- src/inputPlugins/_flac_common.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c index 1ca3aa8c0..1cbce9488 100644 --- a/src/inputPlugins/_flac_common.c +++ b/src/inputPlugins/_flac_common.c @@ -194,16 +194,6 @@ void flac_error_common_cb(const char *plugin, } } -/* keep this inlined, this is just macro but prettier :) */ -static inline enum dc_action flacSendChunk(FlacData * data) -{ - enum dc_action ret = ob_send(data->chunk, data->chunk_length, - data->time, data->bitRate, - data->replayGainInfo); - data->chunk_length = 0; - return ret; -} - static void flac_convert_stereo16(int16_t *dest, const FLAC__int32 * const buf[], unsigned int position, unsigned int end) @@ -295,6 +285,7 @@ flac_common_write(FlacData *data, const FLAC__Frame * frame, bytes_per_sample * frame->header.channels; const unsigned int max_samples = FLAC_CHUNK_SIZE / bytes_per_channel; unsigned int num_samples; + enum dc_action action; assert(dc.audio_format.bits > 0); @@ -315,7 +306,11 @@ flac_common_write(FlacData *data, const FLAC__Frame * frame, data->chunk_length = num_samples * bytes_per_channel; - switch (flacSendChunk(data)) { + action = ob_send(data->chunk, data->chunk_length, + data->time, data->bitRate, + data->replayGainInfo); + data->chunk_length = 0; + switch (action) { case DC_ACTION_STOP: return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; case DC_ACTION_SEEK: -- cgit v1.2.3