[libdvdnav-devel] [PATCH 4/4] Don't abort if PGCN or PCN == 0 when reading VTS_PTT_SRPT

Andrew Clayton andrew at digital-domain.net
Tue Jan 9 16:37:20 CET 2018


On Tue,  9 Jan 2018 15:52:17 +0100
Pierre Lamot <pierre at videolabs.io> wrote:

> ---
>  src/ifo_read.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/ifo_read.c b/src/ifo_read.c
> index 8b31d39..802583d 100644
> --- a/src/ifo_read.c
> +++ b/src/ifo_read.c
> @@ -1263,13 +1263,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
>        CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgcn < 1000); /* ?? */
>        CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn != 0);
>        CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn < 100); /* ?? */
> -      if (vts_ptt_srpt->title[i].ptt[j].pgcn == 0 ||
> -          vts_ptt_srpt->title[i].ptt[j].pgcn >= 1000 ||
> -          vts_ptt_srpt->title[i].ptt[j].pgn == 0 ||
> -          vts_ptt_srpt->title[i].ptt[j].pgn >= 100) {
> -        return 0;
> -      }
> -
> +      //don't abort here. E-One DVDs contain PTT with pgcn or pgn == 0
>      }
>    }
>  

Hmm, these patches look like they will fix at least some issues I've
seen with discs over the years. I've sometimes needed to *hack*
libdvdread to get a disc to work. Indeed the last time was for my
region 2 Arrival disc. I did this to get it working

diff --git a/src/ifo_read.c b/src/ifo_read.c
index 1b899e7..1deac80 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -1056,7 +1056,8 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
     ifofile->tt_srpt = NULL;
     return 0;
   }
-  if(!(DVDReadBytes(ifofile->file, tt_srpt->title, info_length))) {
+  fprintf(stderr, "info_length : %lu\n", info_length);
+  if(!(DVDReadBytes(ifofile->file, tt_srpt->title, 1188))) {
     fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
     ifoFree_TT_SRPT(ifofile);
     return 0;
@@ -1258,7 +1259,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
           vts_ptt_srpt->title[i].ptt[j].pgcn >= 1000 ||
           vts_ptt_srpt->title[i].ptt[j].pgn == 0 ||
           vts_ptt_srpt->title[i].ptt[j].pgn >= 100) {
-        return 0;
+        return 1;
       }
 
     }

That last hunk doing the same as this patch. Good stuff.

Though I note I have this in my commit message

"Works with VLC and mplayer but not lsdvd..."

But that may well have been some other issue that your patches also
resolve. Unfortunately I don't access to that disc right now to test.

Cheers,
Andrew
 


More information about the libdvdnav-devel mailing list