<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class=""><a id="l340" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/disc.c;h=be6a279d30963f0bf2ca7361633bbe9c868a37e7;hb=HEAD#l340" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none; font-family: monospace; white-space: pre;"><font size="2" class=""> </font>340</a><span style="font-family: monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">     struct dec_dev dev = { p->fs_handle, p->pf_file_open_bdrom, p, (file_openFp)disc_open_path, p->disc_root, device_path };</span></div><div class=""><span style="font-family: monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class="">The third member of that structure is p, which is a pointer to a BD_DISC structure.</div><div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class=""><div class="pre" style="font-family: monospace; white-space: pre;"><span style="font-size: small;" class=""> </span>/* device to use */</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l37" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l37" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  37</a> struct dec_dev {</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l38" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l38" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  38</a>     void          *file_open_bdrom_handle;</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l39" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l39" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  39</a>     file_openFp   pf_file_open_bdrom;</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l40" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l40" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  40</a>     void          *file_open_vfs_handle;</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l41" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l41" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  41</a>     file_openFp   pf_file_open_vfs;</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l42" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l42" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  42</a>     const char    *root;   /* may be NULL if disc is not mounted */</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l43" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l43" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  43</a>     const char    *device; /* may be null if not reading from real device */</div><div class="pre" style="font-family: monospace; white-space: pre;"><a id="l44" href="http://git.videolan.org/?p=libbluray.git;a=blob;f=src/libbluray/disc/dec.h;h=d1329be272beb1cba4d9809be9ca343303ca4b7c;hb=HEAD#l44" class="linenr" style="color: rgb(153, 153, 153); text-decoration: none;">  44</a> };</div></div><div class="pre" style="font-family: monospace; white-space: pre;"><br class=""></div><div class="pre" style="white-space: pre;">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.</div><div class="pre" style="white-space: pre;"><br class=""></div><div class="pre" style="white-space: pre;">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 :-(</div><div class="pre" style="white-space: pre;"><br class=""></div><div class="pre" style="white-space: pre;">dgktkr</div></div></div></div></div></body></html>