diff --git a/configure.ac b/configure.ac index cacb8cc66c2cf7f7ceccd31a9493738c6abe57a7..99fc98b5a7b5801b7c5f1e69bdc03d33afd361a9 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AC_TYPE_SIGNAL # required headers AC_HEADER_TIME AC_CHECK_HEADERS([stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h]) -AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h dlfcn.h]) +AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h dlfcn.h inttypes.h]) # required structures AC_STRUCT_DIRENT_D_TYPE diff --git a/src/bluray.c b/src/bluray.c index 905ec9b21b849ae442e2c963b1c1ae956b6aa057..09fc19fdf4596744d28fa69474a18c6c59c257a2 100644 --- a/src/bluray.c +++ b/src/bluray.c @@ -57,7 +57,7 @@ static int _open_m2ts(BLURAY *bd) DEBUG(DBG_BLURAY, "Clip %s empty! (%p)\n", f_name, bd); } - DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open clip %s! (%p)\n", + DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open clip %s! (%p)\n", f_name, bd); X_FREE(f_name); @@ -247,9 +247,9 @@ int _read_block(BLURAY *bd) if (bd->bdplus_fixup && bd->bdplus) { int32_t numFixes; numFixes = bd->bdplus_fixup(bd->bdplus, len, bd->int_buf); -#if 0 +#if 1 if (numFixes) { - DEBUG(DBG_BLURAY, + DEBUG(DBG_BDPLUS, "BDPLUS did %u fixups\n", numFixes); } #endif @@ -528,7 +528,7 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len) } // Select a title for playback -// The title index is an index into the list +// The title index is an index into the list // established by bd_get_titles() int bd_select_title(BLURAY *bd, uint32_t title_idx) { @@ -585,7 +585,7 @@ void bd_seamless_angle_change(BLURAY *bd, int angle) uint32_t clip_pkt; clip_pkt = (bd->clip_pos + 191) / 192; - bd->angle_change_pkt = nav_angle_change_search(bd->clip, clip_pkt, + bd->angle_change_pkt = nav_angle_change_search(bd->clip, clip_pkt, &bd->angle_change_time); bd->request_angle = angle; bd->seamless_angle_change = 1; @@ -646,7 +646,7 @@ BD_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx) } title = nav_title_open(bd->device_path, bd->title_list->title_info[title_idx].name); if (title == NULL) { - DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n", + DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n", bd->title_list->title_info[title_idx].name, bd); return NULL; } diff --git a/src/examples/libbluray_test.c b/src/examples/libbluray_test.c index adf14fa32378246917b967bb2ac62a3d12d0591e..5ca63b8d7d9144849c131ffccd736aad466bd21e 100644 --- a/src/examples/libbluray_test.c +++ b/src/examples/libbluray_test.c @@ -1,3 +1,6 @@ +#if HAVE_CONFIG_H +#include "config.h" +#endif #include #if HAVE_MALLOC_H @@ -5,8 +8,12 @@ #endif #include #include +#if HAVE_INTTYPES_H +#include +#endif #include "../bluray.h" +#include "../util/logging.h" #define HEX_PRINT(X,Y) { int zz; for(zz = 0; zz < Y; zz++) fprintf(stderr, "%02X", X[zz]); fprintf(stderr, "\n"); } @@ -14,6 +21,25 @@ int main(int argc, char *argv[]) { if (argc == 4) { BLURAY *bd = bd_open(argv[1], argv[2]); + int count, ii; + + //bd_get_titles(bd, 0); + + DEBUG(DBG_BLURAY,"\nListing titles:\n"); + + count = bd_get_titles(bd, TITLES_RELEVANT); + for (ii = 0; ii < count; ii++) + { + BD_TITLE_INFO* ti; + ti = bd_get_title_info(bd, ii); + DEBUG(DBG_BLURAY, + "index: %d duration: %02"PRIu64":%02"PRIu64":%02"PRIu64" chapters: %d\n", + ii, + (ti->duration / 90000) / (3600), + ((ti->duration / 90000) % 3600) / 60, + ((ti->duration / 90000) % 60), + ti->chapter_count); + } bd_select_title(bd, atoi(argv[3]));