[matroska] r1019 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2005-01-08 13:08:10 +0300 (Sat, 08 Jan 2005)
New Revision: 1019

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
   trunk/DvdMenuXtractor/IFOFile.cpp
   trunk/DvdMenuXtractor/IFOFile.h
   trunk/DvdMenuXtractor/VobParser.cpp
   trunk/DvdMenuXtractor/VobParser.h
Log:
DMX: only keep the cells that have been used in the output file(s)

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2005-01-06 22:28:25 UTC (rev 1018)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2005-01-08 10:08:10 UTC (rev 1019)
@@ -895,7 +895,7 @@
 				continue;
 
 			const CellListElem * cell_elt = cell_list.Get(position);
-			if (cell_elt == NULL)
+			if (cell_elt == NULL || !cell_elt->found)
 				continue;
 
 			if (cell.block_mode) // multi-angle
@@ -1394,6 +1394,8 @@
 			} while (!language);
 		}
 
+		IfoFile->ArrangeAll();
+
 		GenerateXMLScript();
 
 		m_txtDemuxLog->AppendText("I'm done\n");

Modified: trunk/DvdMenuXtractor/IFOFile.cpp
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.cpp	2005-01-06 22:28:25 UTC (rev 1018)
+++ trunk/DvdMenuXtractor/IFOFile.cpp	2005-01-08 10:08:10 UTC (rev 1019)
@@ -240,6 +240,7 @@
 						cle->start_sector = adt.cell_adr_table[l].start_sector;
 						cle->last_sector = adt.cell_adr_table[l].last_sector;
 						cle->selected = true; // all cells selected for the moment
+						cle->found = false;
 
 						cle->nb_frames = dvdtime2frame(&srp.pgc->cell_playback[k].playback_time, cle->frame_dur);
 						cle->isStill = (srp.pgc->cell_playback[k].still_time > 0);
@@ -284,6 +285,15 @@
 	}
 }
 
+void IFOFile::ArrangeAll()
+{
+	for (size_t i=0; i<m_ifos.GetCount(); i++)
+	{
+		m_ifos[i]->m_CellsList.Arrange();
+		m_ifos[i]->m_langCellsList.Arrange();
+	}
+}
+
 // ----------------------------------------------------------------------------
 
 CellListElem* IFOFile::IsACandidateCell(const unsigned int vobid, const unsigned int cellid)
@@ -670,7 +680,8 @@
 		CellListElem *cell = node->GetData();
 		cell->start_time = timecode;
 		cell->duration = int64_t(cell->frame_dur * cell->nb_frames * 1000000.0);
-		timecode += cell->duration;
+		if (cell->found)
+			timecode += cell->duration;
 		node = node->GetNext();
 	}
 }
\ No newline at end of file

Modified: trunk/DvdMenuXtractor/IFOFile.h
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.h	2005-01-06 22:28:25 UTC (rev 1018)
+++ trunk/DvdMenuXtractor/IFOFile.h	2005-01-08 10:08:10 UTC (rev 1019)
@@ -98,6 +98,7 @@
 	const CellsListType & CellsList(unsigned int title, bool language) const;
 	bool VideoSize(unsigned int title, bool language, uint16_t & width, uint16_t & height, double & fps) const;
 	const uint32_t * GetPalette(unsigned int title, bool language) const;
+	void ArrangeAll();
 
 	uint8_t GetAudioId(uint8_t streamID, uint8_t title, bool language) const;
 	IdArray GetSubsId(uint8_t streamID, uint8_t title, bool language) const;

Modified: trunk/DvdMenuXtractor/VobParser.cpp
===================================================================
--- trunk/DvdMenuXtractor/VobParser.cpp	2005-01-06 22:28:25 UTC (rev 1018)
+++ trunk/DvdMenuXtractor/VobParser.cpp	2005-01-08 10:08:10 UTC (rev 1019)
@@ -245,6 +245,7 @@
 
 					if (cell != NULL)
 					{
+						cell->found = true;
 						if (m_dsi.nv_pck_scr == 0)
 							m_pci_vob_timecode_offset = m_pci.vobu_s_ptm / 90;
 						m_demuxer.SetBoundary(m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_offset, cell->nb_frames * cell->frame_dur, cell);

Modified: trunk/DvdMenuXtractor/VobParser.h
===================================================================
--- trunk/DvdMenuXtractor/VobParser.h	2005-01-06 22:28:25 UTC (rev 1018)
+++ trunk/DvdMenuXtractor/VobParser.h	2005-01-08 10:08:10 UTC (rev 1019)
@@ -61,6 +61,7 @@
 	int64_t duration;
 	bool isStill;
 	bool selected;
+	bool found;
 	//ButtonsListType btt_list;
 } CellListElem;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.