[matroska] r1259 - trunk/foo_input_matroska

[email protected] Tue, 25 Jul 2006 13:42:41 +0400 (MSD)
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
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
=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/foo_input_matroska.cpp	2006-07-17 06:51:18 U=
TC (rev 1258)
+++ trunk/foo_input_matroska/foo_input_matroska.cpp	2006-07-25 09:42:26 U=
TC (rev 1259)
@@ -325,7 +325,7 @@
 			if (!skip_this_frame)
 			{			=09
 				uint64 offset =3D duration_to_samples(0);//m_frame.timecode);
-				uint64 duration =3D duration_to_samples(m_frame->duration);
+				uint64 duration =3D duration_to_samples(m_frame->get_duration());
 				//			console::info(uStringPrintf("duration: %u, offset: %u",duration=
,offset));
=20
 				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 =3D pfc::string_printf(
     "ported to 0.9 by Haru Ayana <[email protected]>\n"
     "Copyright (C) 2003-2004 Jory Stone ([email protected])\n"
-    "Copyright (C) 2003-2004 Peter Pawlowski"
+    "Copyright (C) 2003-2004 Peter Pawlowski\n"
+    "libebml %s + libmatroska %s", MatroskaVersion::lib_ebml(), Matroska=
Version::lib_matroska()
 );
+}
=20
+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
=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-07-17 06:51:18 UTC (r=
ev 1258)
+++ trunk/foo_input_matroska/matroska_parser.h	2006-07-25 09:42:26 UTC (r=
ev 1259)
@@ -121,6 +121,9 @@
 public:
 	MatroskaAudioFrame();
 	void Reset();
+    double get_duration() {
+        return static_cast<double>(duration / 1000000000.0);
+    }
=20
 	uint64 timecode;
 	uint32 duration;