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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] wm/common parse_asf_objects.cpp, 1.12,
From:       gbajaj () helixcommunity ! org
Date:       2008-11-28 5:56:06
Message-ID: 200811280604.mAS64dlF017159 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/wm/common
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv18379

Modified Files:
	parse_asf_objects.cpp parse_audio.cpp 
Log Message:
Chnages needed to Support wma9voice on Head

Index: parse_audio.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/common/parse_audio.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- parse_audio.cpp	18 Sep 2008 23:53:02 -0000	1.3
+++ parse_audio.cpp	28 Nov 2008 05:55:56 -0000	1.4
@@ -43,7 +43,7 @@
     HX_RESULT retVal = HXR_INVALID_PARAMETER;
 
     // Sanity check the inputs
-    if (usFormatTag >= 0x160 && usFormatTag <= 0x163 && ulAvgBytesPerSec && \
pulSamplesPerBlock) +    if (((usFormatTag >= 0x160 && usFormatTag <= 0x163) || \
usFormatTag == 0x000a) && ulAvgBytesPerSec && pulSamplesPerBlock)  {
         // Clear the return value
         retVal = HXR_OK;
@@ -246,6 +246,37 @@
                     }
                 }
             }
+	     else if(pTSD->m_WaveFormatEx.m_usFormatTag == 0x000a)  //WMA9 Voice changes
+	     {
+                // This is WMA 9 Voice
+                //
+                // Make sure we have at least 18 bytes of codec-specific data
+                if (pTSD->m_WaveFormatEx.m_usCodecSpecificDataSize >= 18)
+                {
+                    // Parse the channel mask and the encode options		
+					UnpackUINT16LEInc(&pBuf, &ulLen, &pTSD->m_usValidBitsPerSample);
+					UnpackUINT32LEInc(&pBuf, &ulLen, &pTSD->m_ulChannelMask);
+					UnpackUINT16LEInc(&pBuf, &ulLen, &pTSD->m_usEncodeOptions);	
+
+                    // Round up to the next byte
+                    pTSD->m_WaveFormatEx.m_usBitsPerSample = 8 * \
((pTSD->m_usValidBitsPerSample + 7) / 8); +                    \
pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_CENTER; +                    \
// In WMA 9 Lossless and Pro, there is no specific samples per +                    \
// block field. We must compute it based on the sample +                    // rate \
and encode options. +                    UINT32 ulSamplesPerBlock = 0;
+                    retVal = \
DetermineSamplesPerBlock(pTSD->m_WaveFormatEx.m_usFormatTag, +                        \
pTSD->m_WaveFormatEx.m_ulSamplesPerSec, +                                             \
pTSD->m_WaveFormatEx.m_ulAvgBytesPerSec, +                                            \
pTSD->m_usEncodeOptions, +                                                      \
&ulSamplesPerBlock); +                    if (SUCCEEDED(retVal))
+                    {
+                        // Assign the samples per block
+                        pTSD->m_ulSamplesPerBlock = ulSamplesPerBlock;
+                    }
+                }
+	     }
         }
     }
 

Index: parse_asf_objects.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/common/parse_asf_objects.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- parse_asf_objects.cpp	30 May 2008 15:21:14 -0000	1.12
+++ parse_asf_objects.cpp	28 Nov 2008 05:55:56 -0000	1.13
@@ -2912,7 +2912,7 @@
             m_bErrorCorrectionPresent  = ((ucTmp & 0x80) ? TRUE : FALSE);
             // See if this packet contains opaque error correction data
             m_bOpaqueDataPresent = ((ucTmp & 0x10) ? TRUE : FALSE);
-            // Do we have 
+            // Do we have error correction? 
             if (m_bErrorCorrectionPresent)
             {
                 // If the MS bit is set (error correction is present), then
@@ -2943,6 +2943,16 @@
                     }
                 }
             }
+            else
+            {
+                // No error correction was present, so the first byte of
+                // the ASF Data packet starts with payload parsing information.
+                // However, we still advanced the parsing cursor, so we need to back
+                // up one byte, so that we being parsing the payload information
+                // at the first byte of the ASF data packet.
+                *ppBuf  -= 1;
+                *pulLen += 1;
+            }
             if (SUCCEEDED(retVal) && !m_bOpaqueDataPresent)
             {
                 // Parse the packet length type flags
@@ -3464,7 +3474,7 @@
         // XXXMEH - in network playback, we may get packets which
         // are bigger than the max packet size in the ASF header.
         // So don't assert here.
-//        HX_ASSERT(ulLen == m_ulExpectedPacketSize);
+        // HX_ASSERT(ulLen == m_ulExpectedPacketSize);
         // Sanity check
         HX_ASSERT(ulLen >= ulPayloadHdrLen);
         if (pBuf && ulLen >= ulPayloadHdrLen)


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs


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

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