[matroska] r893 - trunk/DvdMenuXtractor
[email protected] Tue, 19 Oct 2004 00:16:57 +0400 (MSD)
Newsgroups
gmane.comp.multimedia.matroska.cvs
Message-ID
<[email protected] >
Author: robux4
Date: 2004-10-19 00:16:56 +0400 (Tue, 19 Oct 2004)
New Revision: 893
Modified:
trunk/DvdMenuXtractor/IFOFile.cpp
Log:
don't keep duplicate cells
Modified: trunk/DvdMenuXtractor/IFOFile.cpp
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.cpp 2004-10-18 19:28:58 UTC (rev 892)
+++ trunk/DvdMenuXtractor/IFOFile.cpp 2004-10-18 20:16:56 UTC (rev 893)
@@ -167,7 +167,7 @@
// declare a hash map with int keys and CellListElem* values
WX_DECLARE_HASH_MAP( int, CellListElem*, wxIntegerHash, wxIntegerEqual, CellsHashType );
-#define MAKE_CELLS_KEY(__cell_elem__) ((__cell_elem__->vobid << 8) | __cell_elem__->cellid)
+#define MAKE_CELLS_KEY(vob_id,cell_id) ((vob_id << 8) | cell_id)
int wxCMPFUNC_CONV CellListElemCompare(const CellListElem **arg1, const CellListElem **arg2)
{
@@ -191,26 +191,32 @@
pgci_srp_t& srp = pgcit.pgci_srp[j];
for(int k=0; k < srp.pgc->nr_of_cells; k++)
{
- cle = new CellListElem();
- cle->vobid = srp.pgc->cell_position[k].vob_id_nr;
- cle->cellid = srp.pgc->cell_position[k].cell_nr;
+ uint16_t vob_id = srp.pgc->cell_position[k].vob_id_nr;
+ uint8_t cell_id = srp.pgc->cell_position[k].cell_nr;
- if(srp.pgc->cell_playback[k].still_time > 0)
+ if (CellsHash->find(MAKE_CELLS_KEY(vob_id, cell_id)) == CellsHash->end())
{
- // stills
- double frame_rate = ((srp.pgc->cell_playback[k].playback_time.frame_u & 0xc0) >> 6) == 1 ? 25.0 : 30;
- cle->duration = srp.pgc->cell_playback[k].still_time * frame_rate;
- cle->isStill = TRUE;
+ cle = new CellListElem();
+ (*CellsHash)[MAKE_CELLS_KEY(vob_id, cell_id)] = cle;
+
+ cle->vobid = vob_id;
+ cle->cellid = cell_id;
+
+ if(srp.pgc->cell_playback[k].still_time > 0)
+ {
+ // stills
+ double frame_rate = ((srp.pgc->cell_playback[k].playback_time.frame_u & 0xc0) >> 6) == 1 ? 25.0 : 30;
+ cle->duration = srp.pgc->cell_playback[k].still_time * frame_rate;
+ cle->isStill = TRUE;
+ }
+ else
+ {
+ // video
+ cle->duration = dvdtime2frame(&srp.pgc->cell_playback[k].playback_time);
+ cle->isStill = FALSE;
+ }
+ cle->first_sector = srp.pgc->cell_playback[k].first_sector;
}
- else
- {
- // video
- cle->duration = dvdtime2frame(&srp.pgc->cell_playback[k].playback_time);
- cle->isStill = FALSE;
- }
- cle->first_sector = srp.pgc->cell_playback[k].first_sector;
-
- (*CellsHash)[MAKE_CELLS_KEY(cle)] = cle;
}
}
}