FixID3Tag.c

I recently downloaded iTunes 4.9 and got involved in the whole podcasting craze. Soon after, I noticed that the mp3's that I got from the podcasts were exhibiting the same 'bookmarking' feature that audiobooks have in iTunes. That is, if you select another song while one is playing and then you go back to your original song, it starts playing again where it was -- it remembers where it left off. I don't quite like this feature for my normal songs, so I went looking for an answer and found one here:

A new ID3 Frame ID tag was introduced: PCST (or PCS)

This is completely undefined according to the ID3v2.2, ID3v2.3 and ID3v2.4 standards. It would seem that iTunes introduces it somewhere along the way with podcasts. The presence of the tag has these effects:

  • iTunes stores the mp3 in the Podcasts folder. So instead of ~/Music/iTunes/iTunes Music/<artist>/<album>/<name>.mp3 it stores it in ~/Music/iTunes/iTunes Music/Podcasts/<podcast_name>/<name.mp3>
  • iTunes uses 'bookmarking' on the file, whereby it remembers where the song left off

Moreover, with the use of the [user defined] WFED and TGID tags, information about the podcast and where the mp3 came from is stored in the header. I don't happen to like the 'bookmarking' feature in my normal mp3's, so I decided to write a small application to remove the tags that iTunes introduced. It just zero's out those tags, thus removing all references to it being from a podcast and iTunes no longer uses 'bookmarking' on the file.

Source:
   fixid3tag.c v1.5 [12k]

Binary:
   fixid3tag.exe v1.3 [windows]

CHANGES:
   v1.1 - The code no longer zero's out the offending tags. Instead, it shifts all of the tags below the offending tag up and simply pads the end of the header to keep the file the same length
   v1.2 - Fixed two minor bugs in ID3 v2.2 mp3s
   v1.3 - Fixed segfault on large[r] id3 headers. Now works on multiple files.
   v1.4 - Changed header_data from char* to unsigned char* so accomodate all frame sizes. Also cleaned up unused variables.
   v1.5 - Remove TCON and TDES frames now to better support iTunes not thinking it's a podcast. Also support ID3v2.4 tags now.

Usage:
   fixid3tag <mp3-file(s)>

Tested on OSX, Windows and Linux

* Thanks to david and gary who pointed out that v1.0 sometimes made iTunes not recognize all the id3 tags after conversion.
** Thanks to hypert who pointed out a segfault on large[r] id3 headers.
*** Thanks to carey for tracking down the signed/unsigned bug with header_data.

contact: fixid3tag@pixeltree.org