Bug 132191 - Amarok damage ID3V2.4 tags with extended header
Summary: Amarok damage ID3V2.4 tags with extended header
Status: RESOLVED FIXED
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: unspecified FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-10 11:10 UTC by Alexey Illarionov
Modified: 2006-08-30 01:19 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Id3V2.4 tag with extended header. (858 bytes, application/octet-stream)
2006-08-10 11:13 UTC, Alexey Illarionov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Illarionov 2006-08-10 11:10:49 UTC
Version:           1.4.1 (using KDE 3.5.3, compiled sources)
Compiler:          gcc version 3.4.4 [FreeBSD] 20050518
OS:                FreeBSD (i386) release 6.1-STABLE

I have a file tagged with libid3tag. It is a id3v4 tag with expanded header and CRC32 sum in it. That is the first bytes of this file:

$ hexdump -C -n 50 \#dummy2.mp3 
00000000  49 44 33 04 00 40 00 00  08 10 00 00 00 0c 01 20  |ID3..@......... |
00000010  05 06 35 75 4d 78 54 49  54 32 00 00 00 0a 00 01  |..5uMxTIT2......|
00000020  00 00 00 06 03 74 69 74  6c 65 00 00 00 00 00 00  |.....title......|

   Please pay your attention at 6-th byte. It have a value of 0x40 (symbol @). It is an ID3v2 flags byte. The bit 6 indicates that the header is followed by an extended header. And that it is in this tag.
 But when I change and save this file in amarok, I get the following tag:

$ hexdump -C -n 50 \#dummy.mp3 
00000000  49 44 33 04 00 40 00 00  08 10 54 49 54 32 00 00  |ID3..@....TIT2..|
00000010  00 07 00 00 03 74 69 74  6c 65 32 00 00 00 00 00  |.....title2.....|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

   As you see, amarok has removed extended header, but do not change ID3v2 flags byte. Is is still have value of 0x40, but there is no extended header any more. 
   It is really confuses libid3tag. It thinks that such tag are wrong and  does not read them.
  I will attach this file, but it is reproducable on many tags.
Comment 1 Alexey Illarionov 2006-08-10 11:13:06 UTC
Created attachment 17325 [details]
Id3V2.4 tag with extended header.
Comment 2 Seb Ruiz 2006-08-10 12:10:41 UTC
are you using ATF?
Comment 3 Jeff Mitchell 2006-08-10 15:12:13 UTC
What version of TagLib are you using?
Comment 4 Jeff Mitchell 2006-08-10 15:14:14 UTC
CCing Scott Wheeler, this does look like a bug.
Comment 5 Scott Wheeler 2006-08-10 15:17:30 UTC
Yeah, I think I remember fixing something like that a while back, but I'll check it out and make sure that it's not happening for the upcoming 1.5 release.
Comment 6 Alexey Illarionov 2006-08-10 15:27:51 UTC
No i don't. 
I'm read about ATF there: amarok.kde.org/wiki/Advanced_Tag_Features_(ATF)  but i'm not found chebox "Enable writing ATF tags" in options. 
I use Amarok 1.4.1 with taglib-1.4_2 from FreeBSD ports collection.
Comment 7 Scott Wheeler 2006-08-10 15:30:47 UTC
Erm, this one got switched back to amarok (I presume editing at the same time).  Switching it back to TagLib.
Comment 8 Jeff Mitchell 2006-08-10 17:12:49 UTC
Alexey, the option is in the Collection page in the config dialog, at the top.
Comment 9 Scott Wheeler 2006-08-30 01:19:35 UTC
SVN commit 578697 by wheeler:

Make sure that these flags are set to the values that are actually used.

BUG:132191


 M  +6 -0      id3v2header.cpp  
 M  +2 -2      id3v2header.h  


--- trunk/kdesupport/taglib/mpeg/id3v2/id3v2header.cpp #578696:578697
@@ -158,6 +158,12 @@
   v.append(char(4));
   v.append(char(0));
 
+  // Currently we don't actually support writing extended headers or footers, so
+  // make sure that the flags are set accordingly.
+
+  d->extendedHeader = false;
+  d->footerPresent = false;
+
   // render and add the flags
   std::bitset<8> flags;
 
--- trunk/kdesupport/taglib/mpeg/id3v2/id3v2header.h #578696:578697
@@ -128,8 +128,8 @@
       static ByteVector fileIdentifier();
 
       /*!
-       * Sets the data that will be used as the extended header.  10 bytes,
-       * starting from \a data will be used.
+       * Sets the data that will be used as the header.  10 bytes, starting from
+       * the beginning of \a data are used.
        */
       void setData(const ByteVector &data);