[matroska] r1234 - trunk/libmatroska/src

[email protected] Sat, 15 Oct 2005 21:00:01 +0400 (MSD)
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2005-10-15 21:00:00 +0400 (Sat, 15 Oct 2005)
New Revision: 1234

Modified:
   trunk/libmatroska/src/KaxBlock.cpp
Log:
libmatroska: better decision to lace or not

Modified: trunk/libmatroska/src/KaxBlock.cpp
===================================================================
--- trunk/libmatroska/src/KaxBlock.cpp	2005-10-15 16:00:13 UTC (rev 1233)
+++ trunk/libmatroska/src/KaxBlock.cpp	2005-10-15 17:00:00 UTC (rev 1234)
@@ -195,13 +195,16 @@
 	myBuffers.push_back(&buffer);
 
 	// we don't allow more than 8 frames in a Block because the overhead improvement is minimal
-	if (myBuffers.size() >= 8)
+	if (myBuffers.size() >= 8 || lacing == LACING_NONE)
 		return false;
 
-	// decide wether a new frame can be added or not
-	// a frame in a lace is not efficient when the place necessary to code it in a lace is bigger 
-	// than the size of a simple Block. That means more than 6 bytes (4 in struct + 2 for EBML) to code the size
-	return (buffer.Size() < 6*0xFF);
+	if (lacing == LACING_XIPH)
+		// decide wether a new frame can be added or not
+		// a frame in a lace is not efficient when the place necessary to code it in a lace is bigger 
+		// than the size of a simple Block. That means more than 6 bytes (4 in struct + 2 for EBML) to code the size
+		return (buffer.Size() < 6*0xFF);
+	else
+		return true;
 }
 
 /*!