Re: [id3lib-devel] bug reading tracknum?
Brought to you by:
t1mpy
From: Scott W. <sc...@sl...> - 2002-03-24 17:03:58
|
Yep, I fixed that one in CVS a while back. I'll forward you the descript= ion=20 of the bug in a minute. Care to update to CVS? We're really going to tr= y to=20 get a pre3 out soon, as there are a lot of bugs fixed in CVS. -Scott On Sunday 24 March 2002 11:58 am, Douglas Zongker wrote: > Here's a test program with some unexpected behavior: > > #include <stdio.h> > #include <id3/tag.h> > > main( int argc, char** argv ) > { > ID3_Frame* frame; > > // delete all frames from the tag > ID3_Tag tag1( "test.mp3" ); > ID3_Tag::Iterator* iter =3D tag1.CreateIterator(); > while (NULL !=3D (frame =3D iter->GetNext())) > =09tag1.RemoveFrame( frame ); > delete iter; > tag1.Update(); > > // add a tracknum field > ID3_Tag tag2( "test.mp3" ); > frame =3D new ID3_Frame( ID3FID_TRACKNUM ); > frame->GetField( ID3FN_TEXT )->Set( argv[1] ); > tag2.AttachFrame( frame ); > printf( " in: %s\n", frame->GetField( ID3FN_TEXT )->GetRawText(= ) ); > tag2.Update(); > > // read it back. > ID3_Tag tag3( "test.mp3" ); > frame =3D tag3.Find( ID3FID_TRACKNUM ); > printf( "out: %s\n", frame->GetField( ID3FN_TEXT )->GetRawText(= ) ); > } > > When I run this, what I get out of the tracknum field is not always > what I put into it: > > % ./bugtest hello > in: hello > out: hello > % ./bugtest 12 > in: 12 > out: 12 > % ./bugtest 7/9 > in: 7/9 > out: 7 > % ./bugtest 600 > in: 600 > out: 88 > > I'm using linux (RH7.2), g++ 2.96. The problem appears to be in the > parsing -- the tag data looks correct in the MP3 file. Also, it seems > to be specific to TRACKNUM -- I tried substituting a handful of other > "ID3FD_Text" frames (e.g., MIXARTIST, LANGUAGE, etc.) and with those > the strings always matched. > > Any ideas? > > thanks, > dz |