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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] avi/fileformat avistrm.cpp, 1.10.2.13.2.24.2.2,
From:       joeli () helixcommunity ! org
Date:       2011-12-30 3:07:16
[Download RAW message or body]

Update of /cvsroot/datatype/avi/fileformat
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv2876

Modified Files:
      Tag: hxclient_3_6_1_wolf
	avistrm.cpp 
Log Message:
merge one avi sync issue from 361atlas
added by joeli at 2011/12/30


Index: avistrm.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avistrm.cpp,v
retrieving revision 1.10.2.13.2.24.2.2
retrieving revision 1.10.2.13.2.24.2.3
diff -u -d -r1.10.2.13.2.24.2.2 -r1.10.2.13.2.24.2.3
--- avistrm.cpp	22 Nov 2011 09:45:25 -0000	1.10.2.13.2.24.2.2
+++ avistrm.cpp	30 Dec 2011 03:07:13 -0000	1.10.2.13.2.24.2.3
@@ -298,6 +298,16 @@
 #define BI_RGB 0 
 #endif 
 
+typedef struct _mp3_audio_header
+{
+    UINT32 nFlags;
+    UINT16 nID;
+    UINT16 nBlockSize;
+    UINT16 nFramesPerBlock;
+    UINT16 nCodecDelay;
+} MP3_AUDIO_HEADER;
+
+
 /////////////////////////////////////////////////////////////////////////
 //  CAVIStream::CAVIStream
 //
@@ -1130,7 +1140,32 @@
                 pHeader->SetPropertyULONG32("Channels", pWaveInfo->usChannels);
                 //HX_TRACE("\t\tChannels:\t%lu\n", pWaveInfo->usChannels);
 
-                m_fChunksPerSecond = m_pIndex->GetChunkTotal(m_usStream) / ((double) \
m_pIndex->GetByteTotal(m_usStream) / pWaveInfo->ulAvgBytesPerSec); +                \
pHeader->SetPropertyULONG32("BlockAlign", pWaveInfo->usBlockAlign); +
+                if(pWaveInfo->usFormatTag == WAVE_FORMAT_MPEGLAYER3 && \
pWaveInfo->usSize >= sizeof(MP3_AUDIO_HEADER)) +                {
+                    MP3_AUDIO_HEADER* pMP3_hdr = (MP3_AUDIO_HEADER*)(pWaveInfo + 1);
+                    pMP3_hdr->nID = HOST_TO_LE16(pMP3_hdr->nID);
+                    pMP3_hdr->nFlags = HOST_TO_LE32(pMP3_hdr->nFlags);
+                    pMP3_hdr->nBlockSize = HOST_TO_LE16(pMP3_hdr->nBlockSize);
+                    pMP3_hdr->nFramesPerBlock = \
HOST_TO_LE16(pMP3_hdr->nFramesPerBlock); +                    pMP3_hdr->nCodecDelay = \
HOST_TO_LE16(pMP3_hdr->nCodecDelay); +
+                    pHeader->SetPropertyULONG32("MP3_ID", pMP3_hdr->nID);
+                    pHeader->SetPropertyULONG32("MP3_Flags", pMP3_hdr->nFlags);
+                    pHeader->SetPropertyULONG32("BlockSize", pMP3_hdr->nBlockSize);
+                    pHeader->SetPropertyULONG32("MP3_FramesPerBlock", \
pMP3_hdr->nFramesPerBlock); +                    \
pHeader->SetPropertyULONG32("MP3_CodecDelay", pMP3_hdr->nCodecDelay); +               \
} +
+                if(m_header.ulSampleSize)
+                {
+                    m_fChunksPerSecond = m_pIndex->GetChunkTotal(m_usStream) / \
((double) m_pIndex->GetByteTotal(m_usStream) / pWaveInfo->ulAvgBytesPerSec); +        \
} +                else
+                {
+                    m_fChunksPerSecond = (double) m_header.ulRate / \
m_header.ulScale; +                }
                 m_fSamplesPerSecond = (double) m_header.ulRate / m_header.ulScale;
                 break;
             }


_______________________________________________
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