[libdvdnav-devel] [PATCH 06/33] Deprecate ifoFree_TITLE_C_ADT()

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


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

---
 src/dvdread/ifo_read.h |  2 +-
 src/ifo_read.c         | 19 ++++++-------------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/dvdread/ifo_read.h b/src/dvdread/ifo_read.h
index 48d3f98..44a420c 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_TITLE_C_ADT(ifo_handle_t *);
 void ifoFree_TXTDT_MGI(ifo_handle_t *);
 
 /**
@@ -226,6 +225,7 @@ void ifoFree_TXTDT_MGI(ifo_handle_t *);
  * perform no function -- use ifoFree() only.
  */
 void ifoFree_C_ADT(ifo_handle_t *);
+void ifoFree_TITLE_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 e7486b7..c2613ba 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -502,7 +502,11 @@ void ifoClose(ifo_handle_t *ifofile) {
     free(ifofile->menu_c_adt);
   }
 
-  ifoFree_TITLE_C_ADT(ifofile);
+  if(ifofile->vts_c_adt) {
+    free(ifofile->vts_c_adt->cell_adr_table);
+    free(ifofile->vts_c_adt);
+  }
+
   ifoFree_TXTDT_MGI(ifofile);
   ifoFree_VTS_ATRT(ifofile);
   ifoFree_PTL_MAIT(ifofile);
@@ -1716,24 +1720,13 @@ static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
 }
 
 
-static void ifoFree_C_ADT_internal(c_adt_t *c_adt) {
-  if(c_adt) {
-    free(c_adt->cell_adr_table);
-    free(c_adt);
-  }
-}
-
 void ifoFree_C_ADT(ifo_handle_t *ifofile) {
   if(!ifofile)
     return;
 }
 
 void ifoFree_TITLE_C_ADT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-
-  ifoFree_C_ADT_internal(ifofile->vts_c_adt);
-  ifofile->vts_c_adt = NULL;
+  return;
 }
 
 int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) {
-- 
2.0.4



More information about the libdvdnav-devel mailing list