[Matroska-cvs] [matroska] r1259 - trunk/foo_input_matroska

ayana at matroska.org ayana at matroska.org
Tue Jul 25 11:42:41 CEST 2006


Author: ayana
Date: 2006-07-25 13:42:26 +0400 (Tue, 25 Jul 2006)
New Revision: 1259

Modified:
   trunk/foo_input_matroska/foo_input_matroska.cpp
   trunk/foo_input_matroska/matroska_parser.h
Log:
fix: problems some files cause bad allocation

Modified: trunk/foo_input_matroska/foo_input_matroska.cpp
===================================================================
--- trunk/foo_input_matroska/foo_input_matroska.cpp	2006-07-17 06:51:18 UTC (rev 1258)
+++ trunk/foo_input_matroska/foo_input_matroska.cpp	2006-07-25 09:42:26 UTC (rev 1259)
@@ -325,7 +325,7 @@
 			if (!skip_this_frame)
 			{				
 				uint64 offset = duration_to_samples(0);//m_frame.timecode);
-				uint64 duration = duration_to_samples(m_frame->duration);
+				uint64 duration = duration_to_samples(m_frame->get_duration());
 				//			console::info(uStringPrintf("duration: %u, offset: %u",duration,offset));
 
 				if (m_tempchunk.is_empty())
@@ -635,12 +635,20 @@
 #define INPUT_MATROSKA_NAME "Matroska Plugin"
 #endif
 #endif
-DECLARE_COMPONENT_VERSION(
-    INPUT_MATROSKA_NAME,
-    "0.9.1.1",
+
+namespace {
+static const pfc::string8 version = pfc::string_printf(
     "ported to 0.9 by Haru Ayana <ayana at matroska.org>\n"
     "Copyright (C) 2003-2004 Jory Stone (jcsston at toughguy.net)\n"
-    "Copyright (C) 2003-2004 Peter Pawlowski"
+    "Copyright (C) 2003-2004 Peter Pawlowski\n"
+    "libebml %s + libmatroska %s", MatroskaVersion::lib_ebml(), MatroskaVersion::lib_matroska()
 );
+}
 
+DECLARE_COMPONENT_VERSION(
+    INPUT_MATROSKA_NAME,
+    "0.9.1.2",
+    version
+);
+
 DECLARE_FILE_TYPE("Matroska Audio files","*.MKA");

Modified: trunk/foo_input_matroska/matroska_parser.h
===================================================================
--- trunk/foo_input_matroska/matroska_parser.h	2006-07-17 06:51:18 UTC (rev 1258)
+++ trunk/foo_input_matroska/matroska_parser.h	2006-07-25 09:42:26 UTC (rev 1259)
@@ -121,6 +121,9 @@
 public:
 	MatroskaAudioFrame();
 	void Reset();
+    double get_duration() {
+        return static_cast<double>(duration / 1000000000.0);
+    }
 
 	uint64 timecode;
 	uint32 duration;



More information about the Matroska-cvs mailing list