githubのコードからのfolk
Revision | 8a27b90685a5a64f4a126b89d217af6d0b9b50ca (tree) |
---|---|
Time | 2011-02-12 06:38:41 |
Author | jstebbins <jstebbins@b64f...> |
Commiter | jstebbins |
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://localhost/HandBrake/trunk@3796 b64f7644-9d1e-0410-96f1-a4d463321fa5
@@ -51,6 +51,7 @@ struct hb_dvdnav_s | ||
51 | 51 | int title; |
52 | 52 | int title_block_count; |
53 | 53 | int chapter; |
54 | + int cell; | |
54 | 55 | hb_list_t * list_chapter; |
55 | 56 | int stopped; |
56 | 57 | }; |
@@ -1345,6 +1345,7 @@ static int hb_dvdnav_start( hb_dvd_t * e, hb_title_t *title, int c ) | ||
1345 | 1345 | d->title = t; |
1346 | 1346 | d->stopped = 0; |
1347 | 1347 | d->chapter = 0; |
1348 | + d->cell = 0; | |
1348 | 1349 | return 1; |
1349 | 1350 | } |
1350 | 1351 |
@@ -1471,6 +1472,8 @@ static int hb_dvdnav_seek( hb_dvd_t * e, float f ) | ||
1471 | 1472 | dvdnav_err_to_string(d->dvdnav) ); |
1472 | 1473 | return 0; |
1473 | 1474 | } |
1475 | + d->chapter = 0; | |
1476 | + d->cell = 0; | |
1474 | 1477 | return 1; |
1475 | 1478 | } |
1476 | 1479 |
@@ -1610,8 +1613,11 @@ static int hb_dvdnav_read( hb_dvd_t * e, hb_buffer_t * b ) | ||
1610 | 1613 | * and update the decoding/displaying accordingly. |
1611 | 1614 | */ |
1612 | 1615 | { |
1616 | + dvdnav_cell_change_event_t * cell_event; | |
1613 | 1617 | int tt = 0, pgcn = 0, pgn = 0, c; |
1614 | 1618 | |
1619 | + cell_event = (dvdnav_cell_change_event_t*)b->data; | |
1620 | + | |
1615 | 1621 | dvdnav_current_title_program(d->dvdnav, &tt, &pgcn, &pgn); |
1616 | 1622 | if (tt != d->title) |
1617 | 1623 | { |
@@ -1629,6 +1635,11 @@ static int hb_dvdnav_read( hb_dvd_t * e, hb_buffer_t * b ) | ||
1629 | 1635 | } |
1630 | 1636 | chapter = d->chapter = c; |
1631 | 1637 | } |
1638 | + else if ( cell_event->cellN <= d->cell ) | |
1639 | + { | |
1640 | + return 0; | |
1641 | + } | |
1642 | + d->cell = cell_event->cellN; | |
1632 | 1643 | } |
1633 | 1644 | break; |
1634 | 1645 |