aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_control.c
diff options
context:
space:
mode:
authorTim Phipps <mpd@phipps-hutton.freeserve.co.uk>2010-03-21 18:21:47 +0100
committerMax Kellermann <max@duempel.org>2010-03-21 18:21:47 +0100
commite7a515c8b11c643332406d60a13ab1fe06d2b226 (patch)
treeaa7179b453b6fe7b163d1b4b807157359cb436cf /src/decoder_control.c
parente9b75d462c4d0ffee3b3b26582800ec4f657a333 (diff)
downloadmpd-e7a515c8b11c643332406d60a13ab1fe06d2b226.tar.gz
mpd-e7a515c8b11c643332406d60a13ab1fe06d2b226.tar.xz
mpd-e7a515c8b11c643332406d60a13ab1fe06d2b226.zip
Add support for MixRamp tags
Adds mixrampdb and mixrampdelay commands. Reads MIXRAP_START and MIXRAMP_END tags from FLAC files and overlaps instead of crossfading.
Diffstat (limited to '')
-rw-r--r--src/decoder_control.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c
index eeb4670a0..7388d307f 100644
--- a/src/decoder_control.c
+++ b/src/decoder_control.c
@@ -22,6 +22,10 @@
#include "player_control.h"
#include <assert.h>
+#include <malloc.h>
+
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "decoder_control"
void
dc_init(struct decoder_control *dc)
@@ -33,6 +37,10 @@ dc_init(struct decoder_control *dc)
dc->state = DECODE_STATE_STOP;
dc->command = DECODE_COMMAND_NONE;
+
+ dc->mixramp_start = NULL;
+ dc->mixramp_end = NULL;
+ dc->mixramp_prev_end = NULL;
}
void
@@ -40,6 +48,15 @@ dc_deinit(struct decoder_control *dc)
{
g_cond_free(dc->cond);
g_mutex_free(dc->mutex);
+ if (dc->mixramp_start)
+ free(dc->mixramp_start);
+ if (dc->mixramp_end)
+ free(dc->mixramp_end);
+ if (dc->mixramp_prev_end)
+ free(dc->mixramp_prev_end);
+ dc->mixramp_start = NULL;
+ dc->mixramp_end = NULL;
+ dc->mixramp_prev_end = NULL;
}
static void
@@ -147,3 +164,36 @@ dc_quit(struct decoder_control *dc)
g_thread_join(dc->thread);
dc->thread = NULL;
}
+
+void
+dc_mixramp_start(struct decoder_control *dc, char *mixramp_start)
+{
+ assert(dc != NULL);
+
+ if (dc->mixramp_start)
+ free(dc->mixramp_start);
+ dc->mixramp_start = mixramp_start;
+ g_debug("mixramp_start = %s", mixramp_start ? mixramp_start : "NULL");
+}
+
+void
+dc_mixramp_end(struct decoder_control *dc, char *mixramp_end)
+{
+ assert(dc != NULL);
+
+ if (dc->mixramp_end)
+ free(dc->mixramp_end);
+ dc->mixramp_end = mixramp_end;
+ g_debug("mixramp_end = %s", mixramp_end ? mixramp_end : "NULL");
+}
+
+void
+dc_mixramp_prev_end(struct decoder_control *dc, char *mixramp_prev_end)
+{
+ assert(dc != NULL);
+
+ if (dc->mixramp_prev_end)
+ free(dc->mixramp_prev_end);
+ dc->mixramp_prev_end = mixramp_prev_end;
+ g_debug("mixramp_prev_end = %s", mixramp_prev_end ? mixramp_prev_end : "NULL");
+}