[libbluray-devel] [PATCH] Fix current chapter lookup

John Stebbins stebbins at jetheaddev.com
Fri Apr 8 17:35:31 CEST 2016


On 04/02/2016 07:22 AM, John Stebbins wrote:
> From: John Stebbins <jstebbins at jetheaddev.com>
>
> If the current position is before the first chapter in the current clip,
> chapter lookup fails.  This can be seen in US Star Wars IV release where
> chapter events jump from chapter 3 back to 1.
> ---
>  src/libbluray/bdnav/navigation.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
> index 60eccbb..4752196 100644
> --- a/src/libbluray/bdnav/navigation.c
> +++ b/src/libbluray/bdnav/navigation.c
> @@ -754,6 +754,15 @@ uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t clip_pkt)
>              else
>                  return 0;
>          }
> +        if (mark->clip_ref < clip->ref) {
> +            if ( ii == title->chap_list.count - 1 ) {
> +                return ii;
> +            }
> +            mark = &title->chap_list.mark[ii+1];
> +            if (mark->clip_ref == clip->ref && mark->clip_pkt > clip_pkt) {
> +                return ii;
> +            }
> +        }
>          if (mark->clip_ref == clip->ref && mark->clip_pkt <= clip_pkt) {
>              if ( ii == title->chap_list.count - 1 ) {
>                  return ii;

If nobody has any comments or objections, I'll push this soon.

-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20160408/e6aa78e7/attachment.sig>


More information about the libbluray-devel mailing list