[libbluray-devel] Check BD-J capability on demand, cache results

Andreas Zelend ace at kodi.tv
Sun Jun 4 22:48:32 CEST 2017


hi,

this change breaks the check for unsupported titles at line 1014 bluray.c:
        /* mark supported titles */

        if (bd->disc_info.bdj_detected && !bd->disc_info.bdj_handled) {
            bd->disc_info.num_unsupported_titles =
bd->disc_info.num_bdj_titles;
        }

since bdj_handled is not yet checked.

2017-06-01 10:27 GMT+02:00 hpi1 <git at videolan.org>:

> libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Jun  1
> 11:16:17 2017 +0300| [6198fe4918b5dee6aa84a19ee87dffd1188f3add] |
> committer: hpi1
>
> Check BD-J capability on demand, cache results
>
> > http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=
> 6198fe4918b5dee6aa84a19ee87dffd1188f3add
> ---
>
>  src/libbluray/bluray.c | 33 ++++++++++++++++++++-------------
>  1 file changed, 20 insertions(+), 13 deletions(-)
>
> diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
> index 4b50ff2c..e7cb9beb 100644
> --- a/src/libbluray/bluray.c
> +++ b/src/libbluray/bluray.c
> @@ -926,14 +926,6 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO
> *enc_info)
>      bd->disc_info.bdj_detected    = 0;
>      bd->disc_info.bdj_supported   = 1;
>
> -
> -    /* Check if jvm + jar can be loaded ? */
> -    switch (bdj_jvm_available(&bd->bdjstorage)) {
> -    case 2: bd->disc_info.bdj_handled = 1;
> -    case 1: bd->disc_info.libjvm_detected = 1;
> -    default:;
> -    }
> -
>      bd->disc_info.num_titles  = 0;
>      bd->disc_info.titles      = NULL;
>      bd->disc_info.top_menu    = NULL;
> @@ -944,12 +936,10 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO
> *enc_info)
>      memset(bd->disc_info.bdj_org_id,  0, sizeof(bd->disc_info.bdj_org_
> id));
>      memset(bd->disc_info.bdj_disc_id, 0, sizeof(bd->disc_info.bdj_disc_
> id));
>
> -    if (!bd->disc) {
> -      return;
> -    }
> -
> +    if (bd->disc) {
>          bd->disc_info.udf_volume_id = disc_volume_id(bd->disc);
>          index = indx_get(bd->disc);
> +    }
>
>      if (index) {
>          INDX_PLAY_ITEM *pi;
> @@ -1072,10 +1062,27 @@ static void _fill_disc_info(BLURAY *bd,
> BD_ENC_INFO *enc_info)
>              bdid_free(&bdid);
>          }
>      }
> +
> +    if (!bd->disc_info.bdj_handled) {
> +        if (!bd->disc || bd->disc_info.bdj_detected) {
> +
> +            /* Check if jvm + jar can be loaded ? */
> +            switch (bdj_jvm_available(&bd->bdjstorage)) {
> +            case 2: bd->disc_info.bdj_handled = 1;
> +            case 1: bd->disc_info.libjvm_detected = 1;
> +            default:;
> +            }
> +        }
> +    }
>  }
>
>  const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY *bd)
>  {
> +    if (!bd->disc) {
> +        BD_ENC_INFO enc_info;
> +        memset(&enc_info, 0, sizeof(enc_info));
> +        _fill_disc_info(bd, &enc_info);
> +    }
>      return &bd->disc_info;
>  }
>
> @@ -1391,7 +1398,7 @@ BLURAY *bd_init(void)
>          int v = (!strcmp(env, "yes")) ? 1 : (!strcmp(env, "no")) ? 0 :
> atoi(env);
>          bd->bdjstorage.no_persistent_storage = !v;
>      }
> -    _fill_disc_info(bd, NULL);
> +
>      BD_DEBUG(DBG_BLURAY, "BLURAY initialized!\n");
>
>      return bd;
>
> _______________________________________________
> libbluray-devel mailing list
> libbluray-devel at videolan.org
> https://mailman.videolan.org/listinfo/libbluray-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20170604/72d26258/attachment.html>


More information about the libbluray-devel mailing list