[matroska] r1147 - trunk/DvdMenuXtractor
[email protected] Wed, 20 Apr 2005 00:55:04 +0400 (MSD)
Newsgroups
gmane.comp.multimedia.matroska.cvs
Message-ID
<[email protected] >
Author: robux4
Date: 2005-04-20 00:55:02 +0400 (Wed, 20 Apr 2005)
New Revision: 1147
Modified:
trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
trunk/DvdMenuXtractor/IFOFile.cpp
trunk/DvdMenuXtractor/IFOFile.h
Log:
DMX: now store the mapping of the Title vs VTS_TTN to allow correct JumpTT and JumpVTS_TT
Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp 2005-04-19 07:00:00 UTC (rev 1146)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp 2005-04-19 20:55:02 UTC (rev 1147)
@@ -72,7 +72,7 @@
wxString outputDirectory;
wxString mtxDirectory;
const wxString APPLICATION_NAME = "DVDMenuXtractor: DMX - a fair-use tool";
-const wxString APPLICATION_VERSION = "0.9.5";
+const wxString APPLICATION_VERSION = "0.9.6";
// ----------------------------------------------------------------------------
@@ -1267,10 +1267,9 @@
bool GenerateXMLScriptMenu(const wxString & Filename, uint16_t title) const
{
- static unsigned char _PrivateFP[] = {0x30, 0x00, 0x00, 0x00};
- static unsigned char _PrivateVM[] = {0x30, 0xC0, 0x00, 0x00};
- static unsigned char _PrivateVTS[] = {0x30, 0x80, 0x00, 0x00};
- static unsigned char _PrivateTT[] = {0x28, 0x00, 0x00};
+ unsigned char _PrivateFP[] = {0x30, 0x00, 0x00, 0x00};
+ unsigned char _PrivateVM[] = {0x30, 0xC0, 0x00, 0x00};
+ unsigned char _PrivateVTS[] = {0x30, 0x80, 0x00, 0x00};
wxString line, editionUID = CreateUID();
@@ -1352,10 +1351,10 @@
bool GenerateXMLScript(const wxString & Filename, uint16_t title) const
{
- static unsigned char _PrivateFP[] = {0x30, 0x00, 0x00, 0x00};
- static unsigned char _PrivateVM[] = {0x30, 0xC0, 0x00, 0x00};
- static unsigned char _PrivateVTS[] = {0x30, 0x80, 0x00, 0x00};
- static unsigned char _PrivateTT[] = {0x28, 0x00, 0x00};
+ 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);
wxString line, editionUID = CreateUID();
@@ -1401,9 +1400,23 @@
XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
- _PrivateTT[1] = (i+1) >> 8;
- _PrivateTT[2] = (i+1) & 0xFF;
- OutputCodecPrivate(lvl, XmlFile, _PrivateTT, 3);
+ // get the Title -> VTS+TTN map
+ const tt_srpt_t *p_map = IfoFile->TitleMap();
+
+ if ( p_map != NULL )
+ {
+ for (int j=0; j<p_map->nr_of_srpts; j++)
+ {
+ if ( ( p_map->title[j].title_set_nr == title ) && ( p_map->title[j].vts_ttn == i+1 ) )
+ {
+ _PrivateTT[1] = (j+1) >> 8; // Title#
+ _PrivateTT[2] = (j+1) & 0xFF;
+ _PrivateTT[3] = i+1; // VTS_TTN#
+ OutputCodecPrivate(lvl, XmlFile, _PrivateTT, 4);
+ break;
+ }
+ }
+ }
// add the PGC that match this PTT
for (int k=0; k<IfoFile->VtsPGCs(title)->nr_of_pgci_srp; k++)
Modified: trunk/DvdMenuXtractor/IFOFile.cpp
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.cpp 2005-04-19 07:00:00 UTC (rev 1146)
+++ trunk/DvdMenuXtractor/IFOFile.cpp 2005-04-19 20:55:02 UTC (rev 1147)
@@ -147,6 +147,16 @@
// ----------------------------------------------------------------------------
+const tt_srpt_t *IFOFile::TitleMap() const
+{
+ if (m_ifos.Item(0))
+ return m_ifos.Item(0)->GetData()->Handle().tt_srpt;
+ else
+ return NULL;
+}
+
+// ----------------------------------------------------------------------------
+
const pgci_ut_t *IFOFile::LanguageUnits(unsigned int title) const
{
IfoContent *_ifo = m_ifos.GetIfoTitle(title);
@@ -653,4 +663,4 @@
timecode += cell->duration;
node = node->GetNext();
}
-}
+}
\ No newline at end of file
Modified: trunk/DvdMenuXtractor/IFOFile.h
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.h 2005-04-19 07:00:00 UTC (rev 1146)
+++ trunk/DvdMenuXtractor/IFOFile.h 2005-04-19 20:55:02 UTC (rev 1147)
@@ -89,6 +89,7 @@
const CellsListType* GetCellsList(unsigned int title, bool language);
virtual ~IFOFile();
const pgc_t *FirstPlayPGC() const;
+ const tt_srpt_t *TitleMap() const;
const pgci_ut_t *LanguageUnits(unsigned int title) const;
const vts_ptt_srpt_t *VtsTitles(unsigned int title) const;
const pgcit_t *VtsPGCs(unsigned int title) const;