mmserv/metadatautility/Src/MetaDataParserID3v24.cpp
changeset 22 128eb6a32b84
parent 0 71ca22bcf22a
child 28 ebf79c79991a
--- a/mmserv/metadatautility/Src/MetaDataParserID3v24.cpp	Fri May 14 16:22:35 2010 +0300
+++ b/mmserv/metadatautility/Src/MetaDataParserID3v24.cpp	Thu May 27 13:20:50 2010 +0300
@@ -673,10 +673,20 @@
 	TInt length = info.Length();
 	if ( length )
 		{
-		TReal sec = (TReal) atoi((char*)info.Ptr()) / 1000;
-		TBuf16<10> info1;
-		info1.Num(sec, TRealFormat (9, 3));
-		iContainer->AppendL( EMetaDataDuration, info1 );
+		HBufC* data16 = HBufC::NewLC( length );
+		TPtr unicode( data16->Des() );
+		if ( ConvertToUnicodeL(encoding, info, unicode) == KErrNone )
+			{
+			TLex16 lex(unicode);
+			TReal milliSec = 0;
+			TBuf16<10> info1;
+			
+			lex.Val(milliSec);				
+			info1.Num(milliSec/1000, TRealFormat (9, 3));
+			iContainer->AppendL( EMetaDataDuration, info1 );
+			}
+		CleanupStack::PopAndDestroy();  // data16
+		
 		}
 
 	CleanupStack::PopAndDestroy();  // frame