[libdvdnav-devel] [PATCH 13/33] Deprecate ifoFree_TT_SRPT()

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


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

---
 src/dvdread/ifo_read.h |  2 +-
 src/ifo_read.c         | 20 +++++++++-----------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/dvdread/ifo_read.h b/src/dvdread/ifo_read.h
index 711ab96..e0e30b7 100644
--- a/src/dvdread/ifo_read.h
+++ b/src/dvdread/ifo_read.h
@@ -209,7 +209,6 @@ int ifoRead_TXTDT_MGI(ifo_handle_t *);
  * below are safe:  they will not mind if you attempt to free part of an IFO
  * file which was not read in or which does not exist.
  */
-void ifoFree_TT_SRPT(ifo_handle_t *);
 void ifoFree_VTS_PTT_SRPT(ifo_handle_t *);
 void ifoFree_FP_PGC(ifo_handle_t *);
 void ifoFree_PGCIT(ifo_handle_t *);
@@ -225,6 +224,7 @@ void ifoFree_PGCI_UT(ifo_handle_t *);
 void ifoFree_PTL_MAIT(ifo_handle_t *);
 void ifoFree_TITLE_C_ADT(ifo_handle_t *);
 void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *);
+void ifoFree_TT_SRPT(ifo_handle_t *);
 void ifoFree_TXTDT_MGI(ifo_handle_t *);
 void ifoFree_VOBU_ADMAP(ifo_handle_t *);
 void ifoFree_VTS_ATRT(ifo_handle_t *);
diff --git a/src/ifo_read.c b/src/ifo_read.c
index 8475fec..befa046 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -549,7 +549,11 @@ void ifoClose(ifo_handle_t *ifofile) {
     free(ifofile->pgci_ut);
   }
 
-  ifoFree_TT_SRPT(ifofile);
+  if(ifofile->tt_srpt) {
+    free(ifofile->tt_srpt->title);
+    free(ifofile->tt_srpt);
+  }
+
   ifoFree_FP_PGC(ifofile);
   ifoFree_PGCIT(ifofile);
   ifoFree_VTS_PTT_SRPT(ifofile);
@@ -1133,7 +1137,9 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
   }
   if(!(DVDReadBytes(ifofile->file, tt_srpt->title, info_length))) {
     fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
-    ifoFree_TT_SRPT(ifofile);
+    free(ifofile->tt_srpt->title);
+    free(ifofile->tt_srpt);
+    ifofile->tt_srpt = NULL;
     return 0;
   }
 
@@ -1188,15 +1194,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
 
 
 void ifoFree_TT_SRPT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-
-  if(ifofile->tt_srpt) {
-    free(ifofile->tt_srpt->title);
-    free(ifofile->tt_srpt);
-    ifofile->tt_srpt->title = NULL;
-    ifofile->tt_srpt = NULL;
-  }
+  return;
 }
 
 
-- 
2.0.4



More information about the libdvdnav-devel mailing list