[matroska] r1262 - trunk/foo_input_matroska

[email protected] Fri, 13 Oct 2006 00:51:08 +0400 (MSD)
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: ayana
Date: 2006-10-13 00:51:02 +0400 (Fri, 13 Oct 2006)
New Revision: 1262

Modified:
   trunk/foo_input_matroska/DbgOut.h
   trunk/foo_input_matroska/container_matroska_impl.cpp
   trunk/foo_input_matroska/container_matroska_impl.h
   trunk/foo_input_matroska/matroska_parser.cpp
   trunk/foo_input_matroska/matroska_parser.h
Log:
change: cleanup some code around tags and others

Modified: trunk/foo_input_matroska/DbgOut.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/foo_input_matroska/DbgOut.h	2006-10-12 20:50:18 UTC (rev 1261)
+++ trunk/foo_input_matroska/DbgOut.h	2006-10-12 20:51:02 UTC (rev 1262)
@@ -26,6 +26,14 @@
 //#define DEBUG_OUT_PUT
 #include <tchar.h>
 #include <stdarg.h>
+#include <fstream>
+#include <string>
+#include <locale>
+namespace win32
+{
+    typedef std::basic_string< _TCHAR > string;
+    typedef std::basic_fstream< _TCHAR > fstream;
+}
 #define HPRINTF_MES_LENGTH 256
 inline void hprintf( const _TCHAR * format, ... )
 {
@@ -35,6 +43,12 @@
     _vsntprintf(buff, HPRINTF_MES_LENGTH, format, vl);
     va_end(vl);
     OutputDebugString(buff);
+    //*
+    win32::string basicstring(buff);
+    win32::fstream f("foo_input_matroska.debug.txt", std::ios::out|std::=
ios::app);
+    f << basicstring.c_str();
+	f.close();
+    //*/
 }
 #include <boost/timer.hpp>
 #define TIMER boost::timer t

Modified: trunk/foo_input_matroska/container_matroska_impl.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/foo_input_matroska/container_matroska_impl.cpp	2006-10-12 20:50=
:18 UTC (rev 1261)
+++ trunk/foo_input_matroska/container_matroska_impl.cpp	2006-10-12 20:51=
:02 UTC (rev 1262)
@@ -14,7 +14,7 @@
     service_ptr_t<file> file_ptr;
     try {
         filesystem::g_open_read(file_ptr, m_path, *m_abort);
-        matroska_parser_ptr_t parser =3D matroska_parser_ptr_t(new Matro=
skaAudioParser(file_ptr, *m_abort));
+        matroska_parser_ptr parser =3D matroska_parser_ptr(new MatroskaA=
udioParser(file_ptr, *m_abort));
         parser->Parse(p_info_only);
         for (t_size i =3D 0; i !=3D parser->GetAttachmentList().get_coun=
t(); ++i) {
             MatroskaAttachment & item =3D parser->GetAttachmentList().ge=
t_item(i);

Modified: trunk/foo_input_matroska/container_matroska_impl.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/foo_input_matroska/container_matroska_impl.h	2006-10-12 20:50:1=
8 UTC (rev 1261)
+++ trunk/foo_input_matroska/container_matroska_impl.h	2006-10-12 20:51:0=
2 UTC (rev 1262)
@@ -4,7 +4,7 @@
 #include "matroska_parser.h"
 #include "container_matroska.h"
=20
-typedef boost::shared_ptr<MatroskaAudioParser> matroska_parser_ptr_t;
+typedef boost::shared_ptr<MatroskaAudioParser> matroska_parser_ptr;
=20
 class container_matroska_impl : public container_matroska
 {

Modified: trunk/foo_input_matroska/matroska_parser.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/foo_input_matroska/matroska_parser.cpp	2006-10-12 20:50:18 UTC =
(rev 1261)
+++ trunk/foo_input_matroska/matroska_parser.cpp	2006-10-12 20:51:02 UTC =
(rev 1262)
@@ -50,16 +50,21 @@
 #define FOOBAR2K_TAG_IDX 1
=20
 static const char * chapter_tag_mapping[][2] =3D
-{=09
+{
 	{ "PART_NUMBER", "TRACKNUMBER" },
-	{ "DATE_RELEASED", "DATE" }
+	{ "DATE_RELEASED", "DATE" },
+    //{ "LEAD_PERFORMER", "PERFORMER" },
+    //{ "ACCOMPANIMENT", "BAND" },
+    //{ "LYRICIST", "WRITER" }
 };
=20
 static const char * edition_tag_mapping[][2] =3D
 {
 	{ "TITLE", "ALBUM" },
-	{ "SUBTITLE", "SUBALBUM" },
 	{ "CATALOG_NUMBER", "CATALOG" },
+    { "TOTAL_PARTS", "TOTALTRACKS" },
+    //{ "PART_NUMBER", "DISCNUMBER" },
+    //{ "TOTAL_DISCS", "TOTALDISCS" }
 };
=20
 static const char * hidden_edition_field[] =3D
@@ -69,22 +74,22 @@
=20
 static const char * hidden_chapter_field[] =3D
 {
-	"CD_TRACK_FLAGS",
+	"CDAUDIO_TRACK_FLAGS",
 };
=20
 bool starts_with(const string &s, const char *start) {
   return strncmp(s.c_str(), start, strlen(start)) =3D=3D 0;
-}
+};
=20
 uint64 MatroskaAudioParser::SecondsToTimecode(double seconds)
 {
 	return (uint64)floor(seconds * 1000000000);
-}
+};
=20
 double MatroskaAudioParser::TimecodeToSeconds(uint64 code,unsigned sampl=
erate_hint)
 {
 	return ((double)(int64)code / 1000000000);
-}
+};
=20
=20
 MatroskaAudioFrame::MatroskaAudioFrame()=20
@@ -102,7 +107,7 @@
 	SourceFilename =3D L"";
 	SourceStartPos =3D 0;
 	SourceDataLength =3D 0;
-}
+};
=20
 void MatroskaAudioFrame::Reset()
 {
@@ -381,9 +386,8 @@
 						KaxDuration &duration =3D *static_cast<KaxDuration *>(ElementLevel=
2.get());
 						duration.ReadData(m_InputStream.I_O());
=20
-						// it's in milliseconds? -- in seconds.
-						m_Duration =3D float(duration) * m_TimecodeScale;
-						//matroskaGlobalTrack->SetDuration(float(duration) * int64(m_Timec=
odeScale) / 1000000000.0);
+						// it's in milliseconds? -- in nanoseconds.
+						m_Duration =3D double(duration) * m_TimecodeScale;
=20
 					} else if (EbmlId(*ElementLevel2) =3D=3D KaxDateUTC::ClassInfos.Glo=
balId) {
 						KaxDateUTC & DateUTC =3D *static_cast<KaxDateUTC *>(ElementLevel2.=
get());
@@ -470,7 +474,7 @@
=20
 							} else if (TrackEntry[Index1]->Generic().GlobalId =3D=3D KaxTrack=
DefaultDuration::ClassInfos.GlobalId) {
 								KaxTrackDefaultDuration &TrackDefaultDuration =3D *static_cast<K=
axTrackDefaultDuration*>(TrackEntry[Index1]);
-								newTrack.defaultDuration =3D (int64)uint64(TrackDefaultDuration)=
;
+								newTrack.defaultDuration =3D uint64(TrackDefaultDuration);
=20
 							} else if (TrackEntry[Index1]->Generic().GlobalId =3D=3D KaxCodec=
ID::ClassInfos.GlobalId) {
 								KaxCodecID &CodecID =3D *static_cast<KaxCodecID*>(TrackEntry[Ind=
ex1]);
@@ -861,8 +865,9 @@
 			m_Tags.push_back(tempTag);
 			trackTag =3D &m_Tags.at(m_Tags.size()-1);
 		}
-		if(trackTag->targetTypeValue =3D=3D 0)
-			trackTag->targetTypeValue =3D 50;
+		//if(trackTag->targetTypeValue =3D=3D 0)
+		//	trackTag->targetTypeValue =3D 50;
+        trackTag->targetTypeValue =3D 30;
 		trackTag->MarkAllAsRemovalPending();
 		int metaDataCount =3D info.meta_get_count();
 		for (i =3D 0; i < metaDataCount; i++)
@@ -1075,7 +1080,7 @@
 };
=20
 double MatroskaAudioParser::GetDuration() {=20
-	if (m_CurrentChapter !=3D NULL) {=20
+	if (m_CurrentChapter !=3D NULL) {
 		return TimecodeToSeconds(m_CurrentChapter->timeEnd - m_CurrentChapter-=
>timeStart);
 	};
 	return m_Duration / 1000000000.0;
@@ -1161,9 +1166,16 @@
 	for (int i =3D 0; i < tabsize(chapter_tag_mapping); i++)
 		if (!stricmp_utf8(name, chapter_tag_mapping[i][MATROSKA_TAG_IDX]))
 			return chapter_tag_mapping[i][FOOBAR2K_TAG_IDX];
-		return name;
+	return name;
 }
=20
+static void convert_matroska_to_foobar2k_tag(pfc::string_base & p_out, c=
onst char * p_name)
+{
+    pfc::string8 name(p_name);
+    //name.replace_char('_', ' ');
+    p_out =3D name;
+}
+
 static bool IsTagNamed(const MatroskaSimpleTag &currentSimpleTag, const =
char * name)
 {
 	return !stricmp_utf8(currentSimpleTag.name.GetUTF8().c_str(), name);
@@ -1339,6 +1351,7 @@
 				info.meta_add("ALBUM", simpleTag.value.GetUTF8().c_str());
 			}
 		}
+        /*
 		else if(IsTagNamed(simpleTag,"SUBTITLE"))
 		{
 			// Special case for Edition/SUBTITLE
@@ -1348,21 +1361,29 @@
 			} else {
 				info.meta_add("SUBALBUM", simpleTag.value.GetUTF8().c_str());
 			}
-		} else if (IsTagNamed(simpleTag, "DISCID") ||
-				   IsTagNamed(simpleTag, "CATALOG_NUMBER"))
+		}
+        */
+        else if (IsTagNamed(simpleTag, "DISCID") ||
+		         IsTagNamed(simpleTag, "CATALOG_NUMBER") ||
+                 IsTagNamed(simpleTag, "TOTAL_PARTS") ||
+                 IsTagNamed(simpleTag, "PART_NUMBER") ||
+                 IsTagNamed(simpleTag, "TOTAL_DISCS"))
 		{
 			info.meta_add(matroska_to_foobar2k_edition_tag(simpleTag.name.GetUTF8=
().c_str()), simpleTag.value.GetUTF8().c_str());
-		} else if (IsTagNamed(simpleTag,"COMMENTS"))
+		}
+        /*else if (IsTagNamed(simpleTag,"COMMENTS"))
 		{
 			info.meta_add("ALBUM COMMENT", simpleTag.value.GetUTF8().c_str());
-		}
+		}*/
 		else if((!AreTagsIdenticalAtAllLevels(simpleTag.name.GetUTF8().c_str()=
))
 			|| (!TagExistsAtChapterLevel(TrackTags, simpleTag.name.GetUTF8().c_st=
r())))
 		{
 			// Prefix tag with "ALBUM "
 			char newTagName[255] =3D "ALBUM ";
 			strncat(newTagName, matroska_to_foobar2k_edition_tag(simpleTag.name.G=
etUTF8().c_str()),255);
-			info.meta_add(newTagName, simpleTag.value.GetUTF8().c_str());
+            pfc::string8 new_tagname;
+            convert_matroska_to_foobar2k_tag(new_tagname, newTagName);
+			info.meta_add(new_tagname, simpleTag.value.GetUTF8().c_str());
 		}
 		else=20
 		{
@@ -1395,23 +1416,23 @@
 			// Ignore tag
 			simpleTag.hidden =3D true;
 		}
-		else if(IsTagNamed(simpleTag,"COMMENTS"))
+        /*else if(IsTagNamed(simpleTag,"COMMENTS"))
 		{
 			info.meta_add("COMMENT", simpleTag.value.GetUTF8().c_str());
-		}
+		}*/
 		else if(IsTagNamed(simpleTag,"ALBUM"))
 		{
 			if(!TagExistsAtEditionLevel(TrackTags, "TITLE") && AreTagsIdenticalAt=
ChapterLevel("ALBUM")) {
 				info.meta_add("ALBUM", simpleTag.value.GetUTF8().c_str());
 			} else {
-				info.meta_add("ORIGINAL_ALBUM", simpleTag.value.GetUTF8().c_str());
+				info.meta_add("ORIGINAL ALBUM", simpleTag.value.GetUTF8().c_str());
 			}
 		}
 		else
 		{
-			info.meta_add(
-				matroska_to_foobar2k_chapter_tag(simpleTag.name.GetUTF8().c_str()),
-				simpleTag.value.GetUTF8().c_str());=09
+            pfc::string8 new_tagname;
+            convert_matroska_to_foobar2k_tag(new_tagname, matroska_to_fo=
obar2k_chapter_tag(simpleTag.name.GetUTF8().c_str()));
+			info.meta_add(new_tagname, simpleTag.value.GetUTF8().c_str());=09
 		}
 	}
 }
@@ -1441,7 +1462,7 @@
 		ChapterTags =3D FindTagWithChapterUID(m_CurrentChapter->chapterUID,
 			m_Tracks.at(m_CurrentTrackNo).trackUID);
 	}
-	/*
+
 	MatroskaTagInfo *EditionTags =3D NULL;
 	if(m_CurrentEdition !=3D NULL)
 	{
@@ -1452,7 +1473,7 @@
 	{
 		SetAlbumTags(info, EditionTags, ChapterTags);
 	}
-	*/
+
 	if(TrackTags !=3D NULL)
 	{
 		if(TrackTags->targetTypeValue =3D=3D 50)
@@ -1476,12 +1497,13 @@
 		}
 		if ((info.meta_get("TRACKNUMBER", 0) =3D=3D NULL) || (strlen(info.meta=
_get("TRACKNUMBER", 0)) =3D=3D 0))
 		{
-			char trackNumberString[32];
+			//char trackNumberString[32];
+            pfc::string8 trackNumberString;
 #ifdef MULTITRACK		=09
-			wsprintf((LPWSTR)trackNumberString, (LPCWSTR)"%d",
-				(p_subsong % m_Chapters.size()) +1);
+			//wsprintf((LPWSTR)trackNumberString, (LPCWSTR)"%d",
+			//	(p_subsong % m_Chapters.size()) +1);
+            trackNumberString << ((p_subsong % m_Chapters.size()) +1);
 #else
-		=09
 			wsprintf(trackNumberString, "%d",p_subsong+1);
 #endif
 			info.meta_set("TRACKNUMBER", trackNumberString);
@@ -1490,7 +1512,7 @@
 		{
 			if(m_FileTitle.length() > 0)
 				info.meta_set("ALBUM", m_FileTitle.GetUTF8().c_str());
-		}		=09
+		}
 	}
=20
 	return true;
@@ -1698,7 +1720,7 @@
 						//NOTE1("Found Cluster Seek Entry Postion: %u", (unsigned long)las=
tSeekPos);
 						//uint64 orig_pos =3D inputFile.getFilePointer();
 						//MatroskaMetaSeekClusterEntry newCluster;
-                        cluster_entry_ptr_t newCluster(new MatroskaMetaS=
eekClusterEntry());
+                        cluster_entry_ptr newCluster(new MatroskaMetaSee=
kClusterEntry());
 						newCluster->timecode =3D MAX_UINT64;
 						newCluster->filePos =3D static_cast<KaxSegment *>(m_ElementLevel0.=
get())->GetGlobalPosition(lastSeekPos);
 						m_ClusterIndex.push_back(newCluster);
@@ -1999,7 +2021,7 @@
 	//m_framebuffer.set_size(0);
=20
 	if (m_IOCallback.seekable()) {
-		cluster_entry_ptr_t currentCluster =3D FindCluster(m_CurrentTimecode);
+		cluster_entry_ptr currentCluster =3D FindCluster(m_CurrentTimecode);
 		if (currentCluster.get() =3D=3D NULL)
 			return 2;
 		int64 clusterFilePos =3D currentCluster->filePos;
@@ -2071,8 +2093,9 @@
=20
 									newFrame->dataBuffer.resize(1);
 									DataBuffer &buffer =3D DataBlock.GetBuffer(0);
-									newFrame->dataBuffer.at(0).resize(buffer.Size());							=09
-									memcpy(&newFrame->dataBuffer[0][0], buffer.Buffer(), buffer.Siz=
e());
+									newFrame->dataBuffer.at(0).resize(buffer.Size());
+                                       =20
+									memcpy(&newFrame->dataBuffer.at(0).at(0), buffer.Buffer(), buff=
er.Size());
 								}
 							} else {
 								//newFrame->timecode =3D MAX_UINT64;
@@ -2087,7 +2110,7 @@
 						} else if (EbmlId(*ElementLevel3) =3D=3D KaxBlockDuration::ClassIn=
fos.GlobalId) {
 							KaxBlockDuration & BlockDuration =3D *static_cast<KaxBlockDuratio=
n*>(ElementLevel3.get());
 							BlockDuration.ReadData(m_InputStream.I_O());
-							newFrame->duration =3D uint32(BlockDuration);
+							newFrame->duration =3D uint64(BlockDuration);
                         } else if (EbmlId(*ElementLevel3) =3D=3D KaxBloc=
kAdditions::ClassInfos.GlobalId) {
                             ElementLevel4 =3D ElementPtr(m_InputStream.F=
indNextElement(ElementLevel3->Generic().Context, UpperElementLevel, 0xFFF=
FFFFFL, bAllowDummy));
                             while (ElementLevel4 !=3D NullElement) {
@@ -2163,7 +2186,10 @@
 						// !!!!!!!!!!!!!!! HACK ALERT !!!!!!!!!!!!!!!!!!!!!!!!
=20
 						prevFrame =3D newFrame;
-					}
+                    } else {
+                        hprintf(L"newFrame =3D=3D!! delete!!\n");
+                        _DELETE(newFrame);
+                    }
 				}
=20
 				if (UpperElementLevel > 0) {
@@ -2190,9 +2216,9 @@
 		//delete ElementLevel1;
 	=09
 		if (currentCluster->clusterNo < m_ClusterIndex.size()-1) {
-			if (m_ClusterIndex[currentCluster->clusterNo+1]->timecode =3D=3D MAX_=
UINT64)
-				m_ClusterIndex[currentCluster->clusterNo+1]->timecode =3D GetCluster=
Timecode(m_ClusterIndex[currentCluster->clusterNo+1]->filePos);
-			m_CurrentTimecode =3D m_ClusterIndex[currentCluster->clusterNo+1]->ti=
mecode;
+			if (m_ClusterIndex.at(currentCluster->clusterNo+1)->timecode =3D=3D M=
AX_UINT64)
+				m_ClusterIndex.at(currentCluster->clusterNo+1)->timecode =3D GetClus=
terTimecode(m_ClusterIndex.at(currentCluster->clusterNo+1)->filePos);
+			m_CurrentTimecode =3D m_ClusterIndex.at(currentCluster->clusterNo+1)-=
>timecode;
 			if(m_CurrentTimecode =3D=3D 0)
 			{
 				console::error(uStringPrintf("clusterNo : %d, m_ClusterIndex.size() =
: %d", currentCluster->clusterNo, m_ClusterIndex.size()));
@@ -2281,7 +2307,7 @@
 						} else if (EbmlId(*ElementLevel3) =3D=3D KaxBlockDuration::ClassIn=
fos.GlobalId) {
 							KaxBlockDuration & BlockDuration =3D *static_cast<KaxBlockDuratio=
n*>(ElementLevel3.get());
 							BlockDuration.ReadData(m_InputStream.I_O());
-							newFrame->duration =3D uint32(BlockDuration);
+							newFrame->duration =3D uint64(BlockDuration);
 						}
 						if (UpperElementLevel > 0) {
 							UpperElementLevel--;
@@ -2399,7 +2425,7 @@
 	}=09
 };
=20
-cluster_entry_ptr_t MatroskaAudioParser::FindCluster(uint64 timecode)
+cluster_entry_ptr MatroskaAudioParser::FindCluster(uint64 timecode)
 {
 	try {
 		#ifdef _DEBUG_NO_SEEKING
@@ -2413,16 +2439,16 @@
 			// Special case
 			return m_ClusterIndex.at(0);
 	=09
-		cluster_entry_ptr_t correctEntry;
+		cluster_entry_ptr correctEntry;
 		double clusterDuration =3D (double)(int64)m_ClusterIndex.size() / m_Du=
ration;
 		size_t clusterIndex =3D clusterDuration * (double)(int64)timecode;
 		//int lookCount =3D 0;
 		if (clusterIndex > m_ClusterIndex.size())
 			clusterIndex =3D m_ClusterIndex.size()-1;
=20
-		cluster_entry_ptr_t clusterEntry;
-		cluster_entry_ptr_t prevClusterEntry;
-		cluster_entry_ptr_t nextClusterEntry;
+		cluster_entry_ptr clusterEntry;
+		cluster_entry_ptr prevClusterEntry;
+		cluster_entry_ptr nextClusterEntry;
 		while (correctEntry =3D=3D NULL) {
 			clusterEntry =3D m_ClusterIndex.at(clusterIndex);	=09
 			if (clusterIndex > 0)
@@ -2499,7 +2525,7 @@
=20
 		return correctEntry;
 	} catch (...) {
-        cluster_entry_ptr_t null_ptr;
+        cluster_entry_ptr null_ptr;
 		return null_ptr;
 	}
 }
@@ -2507,7 +2533,7 @@
 void MatroskaAudioParser::CountClusters()=20
 {
 	for (uint32 c =3D 0; c < m_ClusterIndex.size(); c++) {
-		cluster_entry_ptr_t clusterEntry =3D m_ClusterIndex.at(c);	=09
+		cluster_entry_ptr clusterEntry =3D m_ClusterIndex.at(c);	=09
 		clusterEntry->clusterNo =3D c;
 	}
 }

Modified: trunk/foo_input_matroska/matroska_parser.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/foo_input_matroska/matroska_parser.h	2006-10-12 20:50:18 UTC (r=
ev 1261)
+++ trunk/foo_input_matroska/matroska_parser.h	2006-10-12 20:51:02 UTC (r=
ev 1262)
@@ -126,7 +126,7 @@
     }
=20
 	uint64 timecode;
-	uint32 duration;
+	uint64 duration;
 	std::vector<ByteArray> dataBuffer;
 	/// Linked-list for laced frames
     uint64 add_id;
@@ -223,16 +223,16 @@
 		UTFstring name;
 		std::string language;
 		double duration;
-	=09
-    uint8 channels;=20
-    float samplesPerSec;=20
-		float samplesOutputPerSec;    =20
-    uint8 bitsPerSample;
-		uint32 avgBytesPerSec;=20
-		float defaultDuration;
+
+        uint8 channels;=20
+        double samplesPerSec;=20
+        double samplesOutputPerSec;    =20
+        uint8 bitsPerSample;
+        uint32 avgBytesPerSec;=20
+        uint64 defaultDuration;
 };
=20
-typedef boost::shared_ptr<MatroskaMetaSeekClusterEntry> cluster_entry_pt=
r_t;
+typedef boost::shared_ptr<MatroskaMetaSeekClusterEntry> cluster_entry_pt=
r;
=20
 class MatroskaAudioParser {
 public:
@@ -302,8 +302,8 @@
     MatroskaAudioFrame * ReadFirstFrame();
=20
 	UTFstring GetSegmentFileName() { return m_SegmentFilename; }
-    typedef pfc::list_t<MatroskaAttachment> attachment_list_t;
-	attachment_list_t &GetAttachmentList() { return m_AttachmentList; }
+    typedef pfc::list_t<MatroskaAttachment> attachment_list;
+	attachment_list &GetAttachmentList() { return m_AttachmentList; }
=20
 protected:
 	void Parse_MetaSeek(ElementPtr metaSeekElement, bool bInfoOnly);
@@ -313,7 +313,7 @@
 	void Parse_Tags(KaxTags *tagsElement);
 	int FillQueue();
 	uint64 GetClusterTimecode(uint64 filePos);
-	cluster_entry_ptr_t FindCluster(uint64 timecode);
+	cluster_entry_ptr FindCluster(uint64 timecode);
 	void CountClusters();
 	void FixChapterEndTimes();
 	// See if the edition uid is already in our vector
@@ -357,9 +357,9 @@
=20
 	/// This is the index of clusters in the file, it's used to seek in the=
 file
 	// std::vector<MatroskaMetaSeekClusterEntry> m_ClusterIndex;
-    std::vector<cluster_entry_ptr_t> m_ClusterIndex;
+    std::vector<cluster_entry_ptr> m_ClusterIndex;
=20
-    attachment_list_t m_AttachmentList;
+    attachment_list m_AttachmentList;
=20
 	uint64 m_CurrentTimecode;
 	double m_Duration;
@@ -384,6 +384,8 @@
 	//MatroskaAudioParser &operator=3D(const MatroskaAudioParser &refParser=
) { return *this; };
 };
=20
+typedef boost::shared_ptr<MatroskaAudioParser> matroska_parser_ptr;
+
 void PrintChapters(std::vector<MatroskaChapterInfo> &theChapters);
=20
 class MatroskaSearch