[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-common-dev
Subject:    [Common-dev] RESEND CR: [bug 9516- new fix] WMA fileformat fix for
From:       ugundeli () real ! com
Date:       2009-10-06 20:50:14
Message-ID: 57594.172.22.141.215.1254862214.squirrel () mailone ! real ! com
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


Sorry. Please disregard the attachment from my previous email.
correct DIFF is attached here.

thank you,
-Umakant.

> Project: Real Player for Android
>
> Synopsis: Modifications to fix the .wma file meta data extraction problem
> in bug 9516.
>
> Overview: This CR is for modifications to fix the .wma file meta data
> extraction problem in bug 9516.
> 1> fix to hlxosstr.cpp: The problem was with '_BIG_ENDIAN' define. the
> android arm os is little endian but because '_BIG_ENDIAN' is defined, the
> big endian related code is executed and thus it gives incorrect results.
> 2> fix to asf_file_format_file.cpp:Allocate an intermediate buffer.
> "Unicode" strings in the ASF format are always stored as UTF16
> little-endian.
> 3> fix to metadataservicce.cpp: for WM format files, extract album title
> and genre from WM/AlbumTitle and WM/Genre fields
>
> Files Added:
> None
>
> Files Modified:
> player/common/dtdr_service/metadata_service/metadataservice.cpp
> datatype/wm/fileformat/asf_file_format_file.cpp
> common/runtime/hlxosstr.cpp
>
> Platforms and Profiles Build and Functionality Verified:
> Platform: android-donut-arm.eabi
> Profile: helix-client-android
> target(s): android_all
>
> Branch: hxclient_3_1_0_atlas_internal
>
> Attachment:
> BUG-9516-WMA-FIX-2.txt
>
> thank you,
>
> -Umakant.

["BUG-9516-WMA-FIX-2.txt" (text/plain)]

Index: hlxosstr.cpp
===================================================================
RCS file: /cvsroot/common/runtime/hlxosstr.cpp,v
retrieving revision 1.25.2.9
diff -u -b -B -r1.25.2.9 hlxosstr.cpp
--- hlxosstr.cpp	5 Mar 2009 06:33:38 -0000	1.25.2.9
+++ hlxosstr.cpp	6 Oct 2009 19:10:07 -0000
@@ -44,7 +44,6 @@
  *    http://www.helixcommunity.org/content/tck
  * 
  * Contributor(s):
- * 
  * ***** END LICENSE BLOCK ***** */
 
 #include "hlxosstr.h"
@@ -404,7 +403,7 @@
 
     while (iInSize > 0)
     {
-#if defined(_BIG_ENDIAN)
+#if defined(_BIG_ENDIAN) && !defined(ANDROID)
 		if (sizeof(wchar_t) == 4)
 		{
 			UINT32 temp = pInWideBuf[used_from_input];


Index: asf_file_format_file.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/fileformat/asf_file_format_file.cpp,v
retrieving revision 1.10.2.7
diff -u -b -B -r1.10.2.7 asf_file_format_file.cpp
--- asf_file_format_file.cpp	10 Apr 2009 00:42:25 -0000	1.10.2.7
+++ asf_file_format_file.cpp	6 Oct 2009 19:24:00 -0000
@@ -2642,7 +2642,25 @@
                     {
                         UINT32 ulNumWideChar = ulValueLen / 2;
                         // Convert to ASCII
-                        HLXOsStrW cStr((const wchar_t*) pValue, ulNumWideChar);
+                        wchar_t* pTmpWChar = new wchar_t [ulNumWideChar + 1];
+                        if (pTmpWChar)
+                        {
+                          // Null out the buffer
+		          memset((void*) pTmpWChar, 0, (ulNumWideChar + 1) * sizeof(wchar_t));
+                          // Set up the input pointers
+                          UINT16 usWChar = 0;
+                          // Copy the string, one wide char at a time
+                          UINT32 i = 0;
+                          for (i = 0; i < ulNumWideChar; i++)
+                            {
+                                usWChar = 0;
+                                UnpackUINT16LE(pValue, ulValueLen, &usWChar);
+                                pTmpWChar[i] = (wchar_t) usWChar;
+                                pValue += 2;
+                                ulValueLen -= 2;
+                            }  
+                        
+                            HLXOsStrW cStr((const wchar_t*) pTmpWChar, \
ulNumWideChar);  // If the output type is string or natural, then
                         // set this into the IHXValues as a CString. Otherwise,
                         // let the failure return code fall through
@@ -2653,6 +2671,8 @@
                             retVal = SetCStringPropertyCCF(pHdr, pszName, (const \
char*) cStr, m_pContext, bForceBuffer);  }
                     }
+                         HX_VECTOR_DELETE(pTmpWChar);
+                    }
                     break;
                 case HX_ASF_Content_Descriptor_Value_BYTE_Array:
                     {

Index: metadataservice.cpp
===================================================================
RCS file: /cvsroot/player/common/dtdr_service/metadata_service/metadataservice.cpp,v
retrieving revision 1.1.2.1
diff -u -b -B -r1.1.2.1 metadataservice.cpp
--- metadataservice.cpp	3 Sep 2008 23:58:57 -0000	1.1.2.1
+++ metadataservice.cpp	6 Oct 2009 19:09:42 -0000
@@ -159,12 +159,31 @@
         m_Abstract= (const char*) pAbstract->GetBuffer();
         m_Album = (const char*) pAbstract->GetBuffer();
     }
+    else
+    {
+        // may be its WMA album title
+        pValues->GetPropertyBuffer("WM/AlbumTitle", pAbstract);
+        if(pAbstract)
+        {
+            m_Abstract= (const char*) pAbstract->GetBuffer();
+            m_Album = (const char*) pAbstract->GetBuffer();
+        }
+    }
 	
     pValues->GetPropertyBuffer("Genre", pGenre);
     if(pGenre)
     {
         m_Genre = (const char*) pGenre->GetBuffer();
     }
+    else
+    {
+        // may be its WMA Genre
+        pValues->GetPropertyBuffer("WM/Genre", pGenre);
+        if(pGenre)
+        {
+            m_Genre = (const char*) pGenre->GetBuffer();
+        }
+    }
 	
     pValues->GetPropertyBuffer("Copyright", pCopyright);
     if(pCopyright)



_______________________________________________
Common-dev mailing list
Common-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/common-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic