[libdvdnav-devel] [PATCH 05/33] Deprecate ifoFree_C_ADT()

beandog at gentoo.org beandog at gentoo.org
Thu Jan 15 21:45:17 CET 2015


From: Steve Dibb <steve.dibb at gmail.com>

---
 src/dvdread/ifo_read.h | 2 +-
 src/ifo_read.c         | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/dvdread/ifo_read.h b/src/dvdread/ifo_read.h
index 905f89d..48d3f98 100644
--- a/src/dvdread/ifo_read.h
+++ b/src/dvdread/ifo_read.h
@@ -217,7 +217,6 @@ void ifoFree_FP_PGC(ifo_handle_t *);
 void ifoFree_PGCIT(ifo_handle_t *);
 void ifoFree_PGCI_UT(ifo_handle_t *);
 void ifoFree_VTS_TMAPT(ifo_handle_t *);
-void ifoFree_C_ADT(ifo_handle_t *);
 void ifoFree_TITLE_C_ADT(ifo_handle_t *);
 void ifoFree_TXTDT_MGI(ifo_handle_t *);
 
@@ -226,6 +225,7 @@ void ifoFree_TXTDT_MGI(ifo_handle_t *);
  * the ifo_handle_t structure and the allocated substructures.  These
  * perform no function -- use ifoFree() only.
  */
+void ifoFree_C_ADT(ifo_handle_t *);
 void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *);
 void ifoFree_VOBU_ADMAP(ifo_handle_t *);
 
diff --git a/src/ifo_read.c b/src/ifo_read.c
index 90f6424..e7486b7 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -497,7 +497,11 @@ void ifoClose(ifo_handle_t *ifofile) {
     free(ifofile->vts_vobu_admap);
   }
 
-  ifoFree_C_ADT(ifofile);
+  if(ifofile->menu_c_adt) {
+    free(ifofile->menu_c_adt->cell_adr_table);
+    free(ifofile->menu_c_adt);
+  }
+
   ifoFree_TITLE_C_ADT(ifofile);
   ifoFree_TXTDT_MGI(ifofile);
   ifoFree_VTS_ATRT(ifofile);
@@ -1722,9 +1726,6 @@ static void ifoFree_C_ADT_internal(c_adt_t *c_adt) {
 void ifoFree_C_ADT(ifo_handle_t *ifofile) {
   if(!ifofile)
     return;
-
-  ifoFree_C_ADT_internal(ifofile->menu_c_adt);
-  ifofile->menu_c_adt = NULL;
 }
 
 void ifoFree_TITLE_C_ADT(ifo_handle_t *ifofile) {
-- 
2.0.4



More information about the libdvdnav-devel mailing list