Fix a problem with filtering and picking correct BD title
authorjstebbins <jstebbins.hb@gmail.com>
Sun, 5 Jun 2011 19:48:05 +0000 (19:48 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Sun, 5 Jun 2011 19:48:05 +0000 (19:48 +0000)
Titles that are the same except for number of chapters were being
filtered out of the title list.  So sometimes you would get a BD title
that didn't seem to have any chapters.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4024 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/libbluray/module.defs
libhb/bd.c
test/test.c

index b6db7c7de967283bba9d6c5faf26b88e1745642d..123eb4cdf02851fea0dceabfa0bff4b6ff703b4b 100644 (file)
@@ -1,7 +1,7 @@
 $(eval $(call import.MODULE.defs,LIBBLURAY,libbluray,LIBXML2))
 $(eval $(call import.CONTRIB.defs,LIBBLURAY))
 
-LIBBLURAY.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libbluray-0.0.1-pre-129-g67ee7bc.tar.gz
+LIBBLURAY.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libbluray-0.0.1-pre-213-ga869da8.tar.gz
 
 LIBBLURAY.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache; ./bootstrap;
 
index 3309d3f7ebccdc9984afb7f17fd7236ea8434243..07d31f7674457a8462f2b402c95ac8fd3648aec4 100644 (file)
@@ -436,6 +436,7 @@ int hb_bd_main_feature( hb_bd_t * d, hb_list_t * list_title )
     int ii;
     uint64_t longest_duration = 0;
     int highest_rank = 0;
+    int most_chapters = 0;
     int rank[8] = {0, 1, 3, 2, 6, 5, 7, 4};
     BLURAY_TITLE_INFO * ti;
 
@@ -455,6 +456,14 @@ int hb_bd_main_feature( hb_bd_t * d, hb_list_t * list_title )
                     longest = title->index;
                     longest_duration = title->duration;
                     highest_rank = rank[bdvideo->format];
+                    most_chapters = ti->chapter_count;
+                }
+                else if (highest_rank == rank[bdvideo->format] &&
+                         title->duration == longest_duration &&
+                         ti->chapter_count > most_chapters)
+                {
+                    longest = title->index;
+                    most_chapters = ti->chapter_count;
                 }
             }
             bd_free_title_info( ti );
@@ -588,6 +597,10 @@ hb_buffer_t * hb_bd_read( hb_bd_t * d )
                     hb_deep_log(2, "bd: Playitem %u", event.param);
                     break;
 
+                case BD_EVENT_STILL:
+                    bd_read_skip_still( d->bd );
+                    break;
+
                 default:
                     break;
             }
index 7e5112e36d2b1a438cbf956be840d5fc63d53757..d2b30124ac1817ffed36a54c53cff1dca2cbc5b5 100644 (file)
@@ -3369,7 +3369,7 @@ static int ParseOptions( int argc, char ** argv )
     return 0;
 }
 
-char * str_printf(const char *fmt, ...)
+static char * str_printf(const char *fmt, ...)
 {
     /* Guess we need no more than 100 bytes. */
     int len;