[libdvdnav-devel] [PATCH 1/4] Provide compatibility with media having incomplete TT_SRPT and PTT_SRPT

Pierre Lamot pierre at videolabs.io
Tue Jan 9 15:52:14 CET 2018


  Some media don't provide the last byte field in  "Title Search Pointer Table"
  (TT_SRPT) and "Video Title Set Part of Title Search Pointer Table"
  (VST_PTT_SRPT)
---
 src/ifo_read.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/ifo_read.c b/src/ifo_read.c
index 1b899e7..aebc184 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -1048,6 +1048,10 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
   B2N_16(tt_srpt->nr_of_srpts);
   B2N_32(tt_srpt->last_byte);
 
+  /* E-One releases don't fill this field */
+  if(tt_srpt->last_byte == 0) {
+    tt_srpt->last_byte = tt_srpt->nr_of_srpts * sizeof(title_info_t) - 1 + TT_SRPT_SIZE;
+  }
   info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE;
 
   tt_srpt->title = calloc(1, info_length);
@@ -1162,6 +1166,10 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
   CHECK_VALUE(vts_ptt_srpt->nr_of_srpts != 0);
   CHECK_VALUE(vts_ptt_srpt->nr_of_srpts < 100); /* ?? */
 
+  /* E-One releases don't fill this field */
+  if(vts_ptt_srpt->last_byte == 0) {
+    vts_ptt_srpt->last_byte  = vts_ptt_srpt->nr_of_srpts * sizeof(*data) - 1 + VTS_PTT_SRPT_SIZE;
+  }
   info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE;
   data = calloc(1, info_length);
   if(!data)
-- 
2.14.1



More information about the libdvdnav-devel mailing list