[MPlayer-dev-eng] [PATCH] Fix for DVD chapter range support

Dave Sainty dave at dtsp.co.nz
Sat Jul 13 09:22:34 CEST 2002


Hi people,

There appears to be a trivial namespace error in determining the valid
chapter range.  It appears that "dvd_title" should be used with
tt_srpt->title[], and "ttn-1" should be used with
vts_file->vts_ptt_srpt->title[].

Whilst I probably should have a better understanding of the code
before making such a rash assumption, it does appear to do the right
thing :)

On the DVD I'm testing on, tt_srpt->title[ttn-1].nr_of_ptts == 1
(which prevents me from using chapter ranges at all) but
tt_srpt->title[dvd_title].nr_of_ptts == 14, which agrees with what
libdvdread outputs as the correct number of chapters.

With this patch applied I can use "-chapter 1-1" on the command line
and play just the first chapter - rather than silently failing to
restrict the play range at all...

Cheers,

Dave

--- libmpdemux/open.c.orig	Sat Jul 13 18:35:52 2002
+++ libmpdemux/open.c	Sat Jul 13 18:36:19 2002
@@ -370,7 +370,7 @@
     d->packs_left=-1;      // for Navi stuff
     d->angle_seek=0;
     /* XXX dvd_last_chapter is in the range 1..nr_of_ptts */
-    if ( dvd_last_chapter > 0 && dvd_last_chapter < tt_srpt->title[ttn-1].nr_of_ptts ) {
+    if ( dvd_last_chapter > 0 && dvd_last_chapter < tt_srpt->title[dvd_title].nr_of_ptts ) {
 	pgn=vts_file->vts_ptt_srpt->title[ttn-1].ptt[dvd_last_chapter].pgn;
 	d->last_cell=d->cur_pgc->program_map[pgn-1] - 1;
     }



More information about the MPlayer-dev-eng mailing list