<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 05/03/2014 04:00 PM, Wout Mertens wrote:<br>
    <blockquote
cite="mid:CAO3V83JG-qbwj0O0C_mpTA_y08sUF2omGOFKEz-ebcc3hK_HUA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <div dir="ltr"><span
          style="font-family:arial,sans-serif;font-size:11px">Hi,</span>
        <div style="font-family:arial,sans-serif;font-size:11px"><br>
        </div>
        <div style="font-family:arial,sans-serif;font-size:11px">I
          noticed that Handbrake patches libbluray with the patch below,
          and it applies cleanly. A candidate for inclusion? I must
          admit I have no idea what it does.</div>
        <div style="font-family:arial,sans-serif;font-size:11px"><br>
        </div>
        <div style="font-family:arial,sans-serif;font-size:11px">Cheers,</div>
        <div style="font-family:arial,sans-serif;font-size:11px"><br>
        </div>
        <div style="font-family:arial,sans-serif;font-size:11px">
          Wout.</div>
        <div style="font-family:arial,sans-serif;font-size:11px"><br>
        </div>
        <div style="font-family:arial,sans-serif;font-size:11px">
          <div>diff --git a/src/libbluray/bdnav/navigation.c
            b/src/libbluray/bdnav/navigation.c</div>
          <div>index c8dc307..26d0000 100644</div>
          <div>--- a/src/libbluray/bdnav/navigation.c</div>
          <div>+++ b/src/libbluray/bdnav/navigation.c</div>
          <div>@@ -32,9 +32,25 @@</div>
          <div> #include <stdlib.h></div>
          <div> #include <string.h></div>
          <div> </div>
          <div>+static int _stream_cmp(MPLS_STREAM *a, MPLS_STREAM *b)</div>
          <div>+{</div>
          <div>+    if (a->stream_type == b->stream_type
            &&</div>
          <div>+        a->coding_type == b->coding_type
            &&</div>
          <div>+        a->pid         == b->pid        
            &&</div>
          <div>+        a->subpath_id  == b->subpath_id
             &&</div>
          <div>+        a->subclip_id  == b->subclip_id
             &&</div>
          <div>+        a->format      == b->format    
             &&</div>
          <div>+        a->rate        == b->rate      
             &&</div>
          <div>+        a->char_code   == b->char_code  
            &&</div>
          <div>+        memcmp(a->lang, b->lang, 4) == 0) {</div>
          <div>+        return 1;</div>
          <div>+    }</div>
          <div>+    return 0;</div>
          <div>+}</div>
          <div>+</div>
          <div> static int _filter_dup(MPLS_PL *pl_list[], unsigned
            count, MPLS_PL *pl)</div>
          <div> {</div>
          <div>-    unsigned ii, jj;</div>
          <div>+    unsigned ii, jj, kk;</div>
          <div> </div>
          <div>     for (ii = 0; ii < count; ii++) {</div>
          <div>         if (pl->list_count !=
            pl_list[ii]->list_count) {</div>
          <div>@@ -54,7 +70,48 @@ static int _filter_dup(MPLS_PL
            *pl_list[], unsigned count, MPLS_PL *pl)</div>
          <div>                 pi1->out_time != pi2->out_time) {</div>
          <div>                 break;</div>
          <div>             }</div>
          <div>+            if (pi1->stn.num_video           !=
            pi2->stn.num_video           ||</div>
          <div>+                pi1->stn.num_audio           !=
            pi2->stn.num_audio           ||</div>
          <div>+                pi1->stn.num_pg              !=
            pi2->stn.num_pg              || </div>
          <div>+                pi1->stn.num_ig              !=
            pi2->stn.num_ig              ||</div>
          <div>+                pi1->stn.num_secondary_audio !=
            pi2->stn.num_secondary_audio ||</div>
          <div>+                pi1->stn.num_secondary_video !=
            pi2->stn.num_secondary_video) {</div>
          <div>+                break;</div>
          <div>+            }</div>
          <div>+            for (kk = 0; kk < pi1->stn.num_video;
            kk++) {</div>
          <div>+                if
            (!_stream_cmp(&pi1->stn.video[kk],
            &pi2->stn.video[kk])) {</div>
          <div>+                    goto next;</div>
          <div>+                }</div>
          <div>+            }</div>
          <div>+            for (kk = 0; kk < pi1->stn.num_audio;
            kk++) {</div>
          <div>+                if
            (!_stream_cmp(&pi1->stn.audio[kk],
            &pi2->stn.audio[kk])) {</div>
          <div>+                    goto next;</div>
          <div>+                }</div>
          <div>+            }</div>
          <div>+            for (kk = 0; kk < pi1->stn.num_pg;
            kk++) {</div>
          <div>+                if (!_stream_cmp(&pi1-><a
              moz-do-not-send="true" href="http://stn.pg/"
              target="_blank">stn.pg</a>[kk], &pi2-><a
              moz-do-not-send="true" href="http://stn.pg/"
              target="_blank">stn.pg</a>[kk])) {</div>
          <div>+                    goto next;</div>
          <div>+                }</div>
          <div>+            }</div>
          <div>+            for (kk = 0; kk < pi1->stn.num_ig;
            kk++) {</div>
          <div>+                if
            (!_stream_cmp(&pi1->stn.ig[kk],
            &pi2->stn.ig[kk])) {</div>
          <div>+                    goto next;</div>
          <div>+                }</div>
          <div>+            }</div>
          <div>+            for (kk = 0; kk <
            pi1->stn.num_secondary_audio; kk++) {</div>
          <div>+                if
            (!_stream_cmp(&pi1->stn.secondary_audio[kk],</div>
          <div>+                                
            &pi2->stn.secondary_audio[kk])) {</div>
          <div>+                    goto next;</div>
          <div>+                }</div>
          <div>+            }</div>
          <div>+            for (kk = 0; kk <
            pi1->stn.num_secondary_video; kk++) {</div>
          <div>+                if
            (!_stream_cmp(&pi1->stn.secondary_video[kk],</div>
          <div>+                                
            &pi2->stn.secondary_video[kk])) {</div>
          <div>+                    goto next;</div>
          <div>+                }</div>
          <div>+            }</div>
          <div>         }</div>
          <div>+next:</div>
          <div>         if (jj != pl->list_count) {</div>
          <div>             continue;</div>
          <div>         }</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
    Hi,<br>
    <br>
    It fixes a problem with the original implementation of _filter_dup. 
    The original implementation is very simple and only checks a few
    things to decide if a title is a duplicate of another title.  This
    resulted in false positive matches and filtering out of the title
    that was needed.  This patch adds comparisons for more fields in the
    playlist to prevent these false positive matches.<br>
    <pre class="moz-signature" cols="120">-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7
</pre>
  </body>
</html>