aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-22 19:04:58 +0200
committerAnton Khirnov <anton@khirnov.net>2013-11-04 11:02:13 +0100
commit982f06ee65f5fbca2d9c50555df43119f6c7b81f (patch)
treeaf7112f67be6b6c3347531cb3fd96c92bf575300
parent78576ca482fbbd209ede96f67e141e28ec446590 (diff)
decoder_api: cosmetics, reformat
-rw-r--r--src/decoder_api.c66
1 files changed, 24 insertions, 42 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 128af5b8..81058ccb 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -36,10 +36,9 @@
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "decoder"
-void
-decoder_initialized(struct decoder *decoder,
- const struct audio_format *audio_format,
- bool seekable, float total_time)
+void decoder_initialized(struct decoder *decoder,
+ const struct audio_format *audio_format,
+ bool seekable, float total_time)
{
struct decoder_control *dc = decoder->dc;
struct audio_format_string af_string;
@@ -80,9 +79,7 @@ decoder_initialized(struct decoder *decoder,
* Checks if we need an "initial seek". If so, then the initial seek
* is prepared, and the function returns true.
*/
-G_GNUC_PURE
-static bool
-decoder_prepare_initial_seek(struct decoder *decoder)
+G_GNUC_PURE static bool decoder_prepare_initial_seek(struct decoder *decoder)
{
const struct decoder_control *dc = decoder->dc;
assert(dc->pipe != NULL);
@@ -127,9 +124,7 @@ decoder_prepare_initial_seek(struct decoder *decoder)
* synthesized command, e.g. to seek to the beginning of the CUE
* track.
*/
-G_GNUC_PURE
-static enum decoder_command
-decoder_get_virtual_command(struct decoder *decoder)
+G_GNUC_PURE static enum decoder_command decoder_get_virtual_command(struct decoder *decoder)
{
const struct decoder_control *dc = decoder->dc;
assert(dc->pipe != NULL);
@@ -140,14 +135,12 @@ decoder_get_virtual_command(struct decoder *decoder)
return dc->command;
}
-enum decoder_command
-decoder_get_command(struct decoder *decoder)
+enum decoder_command decoder_get_command(struct decoder *decoder)
{
return decoder_get_virtual_command(decoder);
}
-void
-decoder_command_finished(struct decoder *decoder)
+void decoder_command_finished(struct decoder *decoder)
{
struct decoder_control *dc = decoder->dc;
@@ -232,9 +225,7 @@ void decoder_seek_error(struct decoder * decoder)
* Should be read operation be cancelled? That is the case when the
* player thread has sent a command such as "STOP".
*/
-G_GNUC_PURE
-static inline bool
-decoder_check_cancel_read(const struct decoder *decoder)
+G_GNUC_PURE static inline bool decoder_check_cancel_read(const struct decoder *decoder)
{
if (decoder == NULL)
return false;
@@ -253,8 +244,8 @@ decoder_check_cancel_read(const struct decoder *decoder)
}
size_t decoder_read(struct decoder *decoder,
- struct input_stream *is,
- void *buffer, size_t length)
+ struct input_stream *is,
+ void *buffer, size_t length)
{
/* XXX don't allow decoder==NULL */
GError *error = NULL;
@@ -297,8 +288,7 @@ size_t decoder_read(struct decoder *decoder,
return nbytes;
}
-void
-decoder_timestamp(struct decoder *decoder, double t)
+void decoder_timestamp(struct decoder *decoder, double t)
{
assert(decoder != NULL);
assert(t >= 0);
@@ -310,8 +300,7 @@ decoder_timestamp(struct decoder *decoder, double t)
* Sends a #tag as-is to the music pipe. Flushes the current chunk
* (decoder.chunk) if there is one.
*/
-static enum decoder_command
-do_send_tag(struct decoder *decoder, const struct tag *tag)
+static enum decoder_command do_send_tag(struct decoder *decoder, const struct tag *tag)
{
struct music_chunk *chunk;
@@ -334,14 +323,11 @@ do_send_tag(struct decoder *decoder, const struct tag *tag)
return DECODE_COMMAND_NONE;
}
-static bool
-update_stream_tag(struct decoder *decoder, struct input_stream *is)
+static bool update_stream_tag(struct decoder *decoder, struct input_stream *is)
{
struct tag *tag;
- tag = is != NULL
- ? input_stream_lock_tag(is)
- : NULL;
+ tag = is != NULL ? input_stream_lock_tag(is) : NULL;
if (tag == NULL) {
tag = decoder->song_tag;
if (tag == NULL)
@@ -359,11 +345,10 @@ update_stream_tag(struct decoder *decoder, struct input_stream *is)
return true;
}
-enum decoder_command
-decoder_data(struct decoder *decoder,
- struct input_stream *is,
- const void *_data, size_t length,
- uint16_t kbit_rate)
+enum decoder_command decoder_data(struct decoder *decoder,
+ struct input_stream *is,
+ const void *_data, size_t length,
+ uint16_t kbit_rate)
{
struct decoder_control *dc = decoder->dc;
const char *data = _data;
@@ -472,9 +457,8 @@ decoder_data(struct decoder *decoder,
return DECODE_COMMAND_NONE;
}
-enum decoder_command
-decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
- const struct tag *tag)
+enum decoder_command decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
+ const struct tag *tag)
{
G_GNUC_UNUSED const struct decoder_control *dc = decoder->dc;
enum decoder_command cmd;
@@ -517,9 +501,8 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
return cmd;
}
-float
-decoder_replay_gain(struct decoder *decoder,
- const struct replay_gain_info *replay_gain_info)
+float decoder_replay_gain(struct decoder *decoder,
+ const struct replay_gain_info *replay_gain_info)
{
float return_db = 0;
assert(decoder != NULL);
@@ -553,9 +536,8 @@ decoder_replay_gain(struct decoder *decoder,
return return_db;
}
-void
-decoder_mixramp(struct decoder *decoder, float replay_gain_db,
- char *mixramp_start, char *mixramp_end)
+void decoder_mixramp(struct decoder *decoder, float replay_gain_db,
+ char *mixramp_start, char *mixramp_end)
{
assert(decoder != NULL);
struct decoder_control *dc = decoder->dc;