-static void fixup_taginfo(char *begin, char *end)
-{
- char *p = begin;
-
- for (;;) {
- p = strchr(p, '\n');
- if (!p)
- break;
- if (p >= end - 1)
- break;
- *p = ' ';
- p++;
- }
-}
-
-/* crap, remove this ASAP. */
-static int fixup_info_string(char *info_string)
-{
- char *t1, *t2, *end;
-
- if (strncmp(info_string, "audio_file_info:", 16))
- return -ERRNO_TO_PARA_ERROR(EINVAL);
- t1 = strstr(info_string, "\ntaginfo1:");
- if (!t1)
- return -ERRNO_TO_PARA_ERROR(EINVAL);
- t2 = strstr(info_string, "\ntaginfo2: ");
- if (!t2)
- return -ERRNO_TO_PARA_ERROR(EINVAL);
-
- end = t2 + strlen(t2) + 1;
- fixup_taginfo(info_string + 16, t1);
- fixup_taginfo(t1 + 10, t2);
- fixup_taginfo(t2 + 10, end);
-
- if (t1 - info_string < 80 && t2 - t1 < 80 && end - t2 < 80)
- return 0;
- if (t1 - info_string >= 80) {
- memmove(info_string + 80, t1, end - t1);
- t1 = info_string + 80;
- t2 -= t1 - info_string - 80;
- end -= t1 - info_string - 80;
- }
- if (t2 - t1 >= 80) {
- memmove(t1 + 80, t2, end - t2);
- end -= t2 - t1 - 80;
- t2 = t1 + 80;
- }
- if (end - t2 >= 80) {
- t2[78] = '\n';
- t2[79] = '\0';
- }
- return 1;
-}
-