[libbluray-devel] Mistake in libbluray/disc/disc.c?

glenn pygr at sonic.net
Sun Mar 18 23:57:02 CET 2018


Hi,

I’ve been trying to get Kodi18, libbluray and libmmbd to play together nicely and I’ve run across what looks to me like a mistake in libbluray 1.0.2 code. Specifically, line 340 of libbluray/disc/disc.c:

 340 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/disc.c;h=be6a279d30963f0bf2ca7361633bbe9c868a37e7;hb=HEAD#l340>     struct dec_dev dev = { p->fs_handle, p->pf_file_open_bdrom, p, (file_openFp)disc_open_path, p->disc_root, device_path };

The third member of that structure is p, which is a pointer to a BD_DISC structure.

However, the declaration of dec_dev (in libbluray/disc/dec.h) seems to indicate that the third member is intended to be a (possibly opaque) handle to be used when calling the function pointed to by the fourth member:

 /* device to use */
  37 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l37> struct dec_dev {
  38 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l38>     void          *file_open_bdrom_handle;
  39 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l39>     file_openFp   pf_file_open_bdrom;
  40 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l40>     void          *file_open_vfs_handle;
  41 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l41>     file_openFp   pf_file_open_vfs;
  42 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l42>     const char    *root;   /* may be NULL if disc is not mounted */
  43 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l43>     const char    *device; /* may be null if not reading from real device */
  44 <http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l44> };

Could someone who is familiar with the code determine whether the line in question will function as originally intended and provide a patch if that is not the case.

I’m in no position to do this myself. I’m just starting to learn C and C++ and can’t properly judge the consequences of any fix that seems to work for me. A little knowledge is a dangerous thing :-(

dgktkr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20180318/98124482/attachment.html>


More information about the libbluray-devel mailing list