summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-02-11 21:38:41 +0000
committerjstebbins <[email protected]>2011-02-11 21:38:41 +0000
commit335e7e305d59063132ddae2fff76e7c6c7b02d47 (patch)
tree76705cc5902d05fd5a7ecafb9ba94fe4544d37c2
parent2289c0d8fae2a1c6d68a10e378d6dc0d510113ae (diff)
Improve loop detection in dvdnav
Loops in titles of only a single chapter were not being detected. We now also check the cell number for loops. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3796 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/dvd.h1
-rw-r--r--libhb/dvdnav.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/libhb/dvd.h b/libhb/dvd.h
index 95f85b1f8..919d3ac8c 100644
--- a/libhb/dvd.h
+++ b/libhb/dvd.h
@@ -51,6 +51,7 @@ struct hb_dvdnav_s
int title;
int title_block_count;
int chapter;
+ int cell;
hb_list_t * list_chapter;
int stopped;
};
diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c
index 7571b57d3..1d22cf50b 100644
--- a/libhb/dvdnav.c
+++ b/libhb/dvdnav.c
@@ -1345,6 +1345,7 @@ static int hb_dvdnav_start( hb_dvd_t * e, hb_title_t *title, int c )
d->title = t;
d->stopped = 0;
d->chapter = 0;
+ d->cell = 0;
return 1;
}
@@ -1471,6 +1472,8 @@ static int hb_dvdnav_seek( hb_dvd_t * e, float f )
dvdnav_err_to_string(d->dvdnav) );
return 0;
}
+ d->chapter = 0;
+ d->cell = 0;
return 1;
}
@@ -1610,8 +1613,11 @@ static int hb_dvdnav_read( hb_dvd_t * e, hb_buffer_t * b )
* and update the decoding/displaying accordingly.
*/
{
+ dvdnav_cell_change_event_t * cell_event;
int tt = 0, pgcn = 0, pgn = 0, c;
+ cell_event = (dvdnav_cell_change_event_t*)b->data;
+
dvdnav_current_title_program(d->dvdnav, &tt, &pgcn, &pgn);
if (tt != d->title)
{
@@ -1629,6 +1635,11 @@ static int hb_dvdnav_read( hb_dvd_t * e, hb_buffer_t * b )
}
chapter = d->chapter = c;
}
+ else if ( cell_event->cellN <= d->cell )
+ {
+ return 0;
+ }
+ d->cell = cell_event->cellN;
}
break;