diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/brokentags.c | 16 |
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; +} |