summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2021-03-12 03:55:34 +0100
committerSuren A. Chilingaryan <csa@suren.me>2021-03-12 03:55:34 +0100
commit60bd665e74cfeeaf70882173a0dd56c883e2014a (patch)
tree8a0066bb9f0259becac5605641e8e1eed1ae0e89 /misc
downloadrusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.tar.gz
rusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.tar.bz2
rusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.tar.xz
rusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.zip
Added to git tree
Diffstat (limited to 'misc')
-rw-r--r--misc/brokentags.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/misc/brokentags.c b/misc/brokentags.c
new file mode 100644
index 0000000..e850057
--- /dev/null
+++ b/misc/brokentags.c
@@ -0,0 +1,16 @@
+/* I tried to use it to fix broken tags (call id3_get_text), but
+it really didn't help much (half of title tag, instead of one fourth) */
+void id3_fix_text(struct id3_frame *frame, int offset) {
+ int i, size;
+ char *string;
+
+ size = frame->fr_size - offset - 1;
+ string = ID3_TEXT_FRAME_PTR(frame) + offset;
+
+ for (offset=0, i=0;i<size;i++) {
+ if (!string[i]) offset++;
+ else if (offset) string[i-offset] = string[i];
+ }
+
+ for (;offset>0;offset--) string[i-offset]=0;
+}