[matroska] r1177 - trunk/DvdMenuXtractor

[email protected] Tue, 17 May 2005 20:30:45 +0400 (MSD)
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2005-05-17 20:30:44 +0400 (Tue, 17 May 2005)
New Revision: 1177

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
Log:
DMX: mark the VMG as such in the chapter (spec compliant now)

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2005-05-17 14:37:34 UTC (rev 1176)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2005-05-17 16:30:44 UTC (rev 1177)
@@ -1338,15 +1338,27 @@
 			if (IfoFile->LanguageUnits(title) && IfoFile->LanguageUnits(title)->nr_of_lus)
 			{
 				// VTS Menu
-				XmlFile.AddLine(IndentString(lvl)+"<!-- Video Title Set -->");
+				if ( title == 0 )
+					XmlFile.AddLine(IndentString(lvl)+"<!-- Video Manager -->");
+				else
+					XmlFile.AddLine(IndentString(lvl)+"<!-- Video Title Set -->");
 				XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
 					lvl++;
 					wxString _myUIDa = CreateUID();
 					XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
 					XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
-					_PrivateVTS[2] = title >> 8;
-					_PrivateVTS[3] = title & 0xFF;
-					OutputCodecPrivate(lvl, XmlFile, _PrivateVTS, 4);
+					if ( title != 0 )
+					{
+						_PrivateVTS[2] = title >> 8;
+						_PrivateVTS[3] = title & 0xFF;
+						OutputCodecPrivate(lvl, XmlFile, _PrivateVTS, 4);
+					}
+					else
+					{
+						_PrivateVM[2] = 0;
+						_PrivateVM[3] = 0;
+						OutputCodecPrivate(lvl, XmlFile, _PrivateVM, 4);
+					}
 
 					uint64_t start_time = HandleLanguageUnit(lvl, XmlFile, *IfoFile, title);
 
@@ -1366,8 +1378,6 @@
 
 	bool GenerateXMLScript(const wxString & Filename, uint16_t title, const wxString & editionUID) const
 	{
-		unsigned char _PrivateFP[]  = {0x30, 0x00, 0x00, 0x00};
-		unsigned char _PrivateVM[]  = {0x30, 0xC0, 0x00, 0x00};
 		unsigned char _PrivateVTS[] = {0x30, 0x80, 0x00, 0x00};
 		unsigned char _PrivateTT[]  = {0x28, 0x00, 0x00, 0x00};
 		uint64_t start_timeH = uint64_t(-1);