summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2007-10-28 11:09:55 +0000
committerMagnus Holmgren <magnushol@gmail.com>2007-10-28 11:09:55 +0000
commit868d3ce39c9675ec778fa53a592b471775662264 (patch)
tree425aa20b288aad094a15a6afa6a6a8d16bb69cf5
parent28f6ae49ec1b1d3464add2941eb015bab56f8016 (diff)
downloadrockbox-868d3ce39c9675ec778fa53a592b471775662264.tar.gz
rockbox-868d3ce39c9675ec778fa53a592b471775662264.zip
Add ReplayGain support to WMA (based on tags written by Foobar2000).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15340 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/metadata/asf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/metadata/asf.c b/apps/metadata/asf.c
index a5136b3da7..65c99f4b07 100644
--- a/apps/metadata/asf.c
+++ b/apps/metadata/asf.c
@@ -25,6 +25,7 @@
25#include <inttypes.h> 25#include <inttypes.h>
26 26
27#include "id3.h" 27#include "id3.h"
28#include "replaygain.h"
28#include "debug.h" 29#include "debug.h"
29#include "rbunicode.h" 30#include "rbunicode.h"
30#include "metadata_common.h" 31#include "metadata_common.h"
@@ -441,6 +442,19 @@ static int asf_parse_header(int fd, struct mp3entry* id3,
441 } else { 442 } else {
442 lseek(fd, length, SEEK_CUR); 443 lseek(fd, length, SEEK_CUR);
443 } 444 }
445 } else if (!strncmp("replaygain_", utf8buf, 11)) {
446 char* value = id3buf;
447 int buf_len = id3buf_remaining;
448 int len;
449 asf_utf16LEdecode(fd, length, &id3buf, &id3buf_remaining);
450 len = parse_replaygain(utf8buf, value, id3,
451 value, buf_len);
452
453 if (len == 0) {
454 /* Don't need to keep the value */
455 id3buf = value;
456 id3buf_remaining = buf_len;
457 }
444 } else { 458 } else {
445 lseek(fd, length, SEEK_CUR); 459 lseek(fd, length, SEEK_CUR);
446 } 460 }