[ID3 Dev] Padding

Ion Todirel iontodirel at yahoo.co.uk
Tue Aug 23 15:12:42 PDT 2005


thanks very much Ben, i stiil dont understand why footer and padding are mutually exclusive? if i have this situation, all sems to be OK?
 
<tag header>
<TIT1 header><TIT1 contents>
<TIT2 header><TIT2 contents>
<padding>
<mp3 audio data>
<tag footer>
<ID3v1 tag>
 
and second problem:
 
here is a simple tag:
 
<tag header>
<"frame ID" header><"frame ID" content>
...
<"frame IDi" header><"frame IDi" content>
...
<"frame IDn" header><"frame IDn" content> (last frame (normal frame))

<padding>                                                 (lets say 100%)
<audio data>
<ID3v1>







 
Ben, way just not add two new frames like this?:
 
<tag header>
<"frame ID" header><"frame ID" content>
...
<"frame IDi" header><"frame IDi" content>
...
<"frame IDn" header><"frame IDn" content>

<"frame IDn+1" content><"frame IDn+1" content> (added frame)

<"frame IDn+2" content><"frame IDn+2" content> (added frame)                                 
<padding>                                                          (after adding two frames padding = padding - x bytes)   
<audio data>
<ID3v1>







 
but add like you say?:
 
<tag header>
<"frame ID1" header>
<"frame ID2" header>
<"frame ID3" header><"frame ID3" content>
...
<"frame IDi" header><"frame IDi" content>
...
<"frame IDn" header><"frame IDn" content> (last frame (normal frame))

<"frame ID1" content>          
<"frame ID2" content>                                  
<padding>                                                 (same situation) 
<audio data>
<ID3v1>
 
Thanks, again









Ben Bennett <fiji at ayup.limey.net> wrote:On Tue, Aug 23, 2005 at 10:00:26PM +0100, Ion Todirel wrote:
> If i use padding to add a new frame: let's say that i have a tag with TIT1 and TIT2: 
> 
> 
> 
> 
> 
> 
> 
> 

Yes.

> 
> if i add a new frame (TALB) using padding tag will look like this?:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

No.

The TALB is a frame and MUST be inside the ID3 tag. The padding also
falls inside the tag, (i.e. is included in the tag size) but MUST
follow all frames. So it will look like:













> if frame TALB already exists in the tag:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

Okay.

> and i extend it using padding:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

Again, no. You can not split the additional content from TALB. There
can only be one TALB frame per tag. So it will look like:













> But how to detect when padding starts? just before last frame, but how to detect when is last frame?

Padding falls after all frames. It is the last thing in the tag. So
if you expect to see a frame header but read all nuls then you are
into the padding.

The only point to padding is to prevent rewriting all of the content
in the file if a tag grows. So if you have N bytes of padding at the
end of a frame and you grow the content by N bytes or less, you can
just rewrite the tag and shrink the padding. But if you need to grow
something by more than N bytes then you need to fiddle with the
remainder of the file as well.

Does that help?

-ben

---------------------------------------------------------------------
To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
For additional commands, e-mail: id3v2-help at id3.org



		
---------------------------------
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.id3.org/pipermail/id3v2/attachments/20050823/e9b54ac3/attachment.html>


More information about the ID3v2 mailing list