<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7100.4137"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>Hi,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I have an MPEG file with some existing ID3v2 Tags. I
want to add my own PrivateFrame to the ID3v2 Tags of this file.</FONT></DIV>
<DIV><FONT face=Calibri>After adding the Frame, I noticed what appear to be
several bytes of padding after the PrivateFrame I just added. Can someone
suggest what might be wrong, or provide suggestions on how I avoid these padding
bytes from bloating my header?</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Here's my code. </FONT><FONT face=Calibri>I have tried
both alternatives below and they result in the same several bytes of empty
padding:</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<DIV><FONT size=2 face=Arial>bool File::EmbedPrivateFrame( string path, string
strPayload )<BR>{<BR> bool success =
false;<BR> TagLib::MPEG::File f( path.c_str()
);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> TagLib::ID3v2::Tag* tag =
f.ID3v2Tag();<BR> if( tag != NULL )<BR>
{<BR> TagLib::ID3v2::PrivateFrame*
privFrame = new TagLib::ID3v2::PrivateFrame(); // don't delete - transfer
ownership to tag<BR>
privFrame->setOwner("www.foobar.com");<BR>
privFrame->setData(strPayload.c_str());<BR>
tag->addFrame( privFrame );<BR>
success = f.save();<BR> }</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> return
success;<BR>}</FONT></DIV></BLOCKQUOTE>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<DIV>
<DIV><FONT size=2 face=Arial>bool File::EmbedPrivateFrame( string path, string
strPayload )<BR>{<BR></FONT><FONT size=2 face=Arial> bool
success = false;<BR> TagLib::MPEG::File f( path.c_str()
);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial> TagLib::ID3v2::Tag* tag
= f.ID3v2Tag();<BR> if( tag != NULL )<BR>
{<BR> TagLib::ByteVector
data(strPayload.c_str(),
strPayload.length());<BR>
TagLib::ID3v2::PrivateFrame* privFrame = new TagLib::ID3v2::PrivateFrame(); //
don't delete - transfer ownership to
tag<BR>
privFrame->setOwner("</FONT><FONT title=""
face=Arial>www.foobar.com</FONT><FONT
face=Arial>");<BR>
privFrame->setData(data);<BR>
tag->addFrame( privFrame );<BR>
success = f.save(<FONT
size=2>TagLib::MPEG::File::AllTags</FONT>);<BR>
}</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> return
success;<BR>}</FONT></DIV></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV> </DIV></BODY></HTML>