aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_parser.c')
-rw-r--r--src/audio_parser.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/audio_parser.c b/src/audio_parser.c
index 139cf1c04..b1be8887a 100644
--- a/src/audio_parser.c
+++ b/src/audio_parser.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -81,6 +81,18 @@ parse_sample_format(const char *src, bool mask,
return true;
}
+ if (*src == 'f') {
+ *sample_format_r = SAMPLE_FORMAT_FLOAT;
+ *endptr_r = src + 1;
+ return true;
+ }
+
+ if (memcmp(src, "dsd", 3) == 0) {
+ *sample_format_r = SAMPLE_FORMAT_DSD;
+ *endptr_r = src + 3;
+ return true;
+ }
+
value = strtoul(src, &endptr, 10);
if (endptr == src) {
g_set_error(error_r, audio_parser_quark(), 0,
@@ -98,11 +110,11 @@ parse_sample_format(const char *src, bool mask,
break;
case 24:
- if (memcmp(endptr, "_3", 2) == 0) {
- sample_format = SAMPLE_FORMAT_S24;
+ if (memcmp(endptr, "_3", 2) == 0)
+ /* for backwards compatibility */
endptr += 2;
- } else
- sample_format = SAMPLE_FORMAT_S24_P32;
+
+ sample_format = SAMPLE_FORMAT_S24_P32;
break;
case 32: