[libbluray-devel] Fixed chapter byte positions in BLURAY_TITLE_INFO. Chapter byte position depends on selected angle.

hpi1 git at videolan.org
Mon Jun 13 17:24:48 CEST 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue May 10 15:21:08 2011 +0300| [80779fae8dbcf38a269e5d86e6acd75617f65ab4] | committer: hpi1

Fixed chapter byte positions in BLURAY_TITLE_INFO. Chapter byte position depends on selected angle.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=80779fae8dbcf38a269e5d86e6acd75617f65ab4
---

 player_wrappers/xine/input_bluray.c |    6 +++---
 src/examples/bdsplice.c             |    2 +-
 src/examples/libbluray_test.c       |    2 +-
 src/examples/list_titles.c          |    2 +-
 src/libbluray/bluray.c              |   14 ++++++++------
 src/libbluray/bluray.h              |    6 ++++--
 6 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/player_wrappers/xine/input_bluray.c b/player_wrappers/xine/input_bluray.c
index 4527f91..9dabf2a 100644
--- a/player_wrappers/xine/input_bluray.c
+++ b/player_wrappers/xine/input_bluray.c
@@ -231,9 +231,9 @@ static void update_title_info(bluray_input_plugin_t *this, int playlist_id)
     bd_free_title_info(this->title_info);
 
   if (playlist_id < 0)
-    this->title_info = bd_get_title_info(this->bdh, this->current_title_idx);
+    this->title_info = bd_get_title_info(this->bdh, this->current_title_idx, 0);
   else
-    this->title_info = bd_get_playlist_info(this->bdh, playlist_id);
+    this->title_info = bd_get_playlist_info(this->bdh, playlist_id, 0);
 
   pthread_mutex_unlock(&this->title_info_mutex);
 
@@ -1101,7 +1101,7 @@ static int bluray_plugin_open (input_plugin_t *this_gen)
     uint64_t duration = 0;
     int i, playlist = 99999;
     for (i = 0; i < this->num_title_idx; i++) {
-      BLURAY_TITLE_INFO *info = bd_get_title_info(this->bdh, i);
+      BLURAY_TITLE_INFO *info = bd_get_title_info(this->bdh, i, 0);
       if (info->duration > duration) {
         title    = i;
         duration = info->duration;
diff --git a/src/examples/bdsplice.c b/src/examples/bdsplice.c
index d654541..c7b6b9e 100644
--- a/src/examples/bdsplice.c
+++ b/src/examples/bdsplice.c
@@ -162,7 +162,7 @@ main(int argc, char *argv[])
         out = stdout;
     }
 
-    ti = bd_get_title_info(bd, title_no);
+    ti = bd_get_title_info(bd, title_no, angle);
 
     if (angle >= (int)ti->angle_count) {
         fprintf(stderr, "Invalid angle %d > angle count %d. Using angle 1.\n", 
diff --git a/src/examples/libbluray_test.c b/src/examples/libbluray_test.c
index 646d822..5fc4a6b 100644
--- a/src/examples/libbluray_test.c
+++ b/src/examples/libbluray_test.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
     for (ii = 0; ii < count; ii++)
     {
         BLURAY_TITLE_INFO* ti;
-        ti = bd_get_title_info(bd, ii);
+        ti = bd_get_title_info(bd, ii, 0);
         BD_DEBUG(DBG_BLURAY,
        "index: %d duration: %02"PRIu64":%02"PRIu64":%02"PRIu64" chapters: %d\n",
               ii,
diff --git a/src/examples/list_titles.c b/src/examples/list_titles.c
index 3f91f74..d9f3138 100644
--- a/src/examples/list_titles.c
+++ b/src/examples/list_titles.c
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
     for (ii = 0; ii < count; ii++)
     {
         BLURAY_TITLE_INFO* ti;
-        ti = bd_get_title_info(bd, ii);
+        ti = bd_get_title_info(bd, ii, 0);
         if (ti->duration / 90000 < seconds)
         {
             continue;
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 3567527..5de1105 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1541,12 +1541,13 @@ static BLURAY_TITLE_INFO* _fill_title_info(NAV_TITLE* title, uint32_t title_idx,
     return title_info;
 }
 
-static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32_t playlist, const char *mpls_name)
+static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32_t playlist, const char *mpls_name,
+                                          unsigned angle)
 {
     NAV_TITLE *title;
     BLURAY_TITLE_INFO *title_info;
 
-    title = nav_title_open(bd->device_path, mpls_name, 0);
+    title = nav_title_open(bd->device_path, mpls_name, angle);
     if (title == NULL) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n",
               mpls_name, bd);
@@ -1559,7 +1560,7 @@ static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32
     return title_info;
 }
 
-BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx)
+BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
 {
     if (bd->title_list == NULL) {
         BD_DEBUG(DBG_BLURAY, "Title list not yet read! (%p)\n", bd);
@@ -1572,15 +1573,16 @@ BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx)
 
     return _get_title_info(bd,
                            title_idx, bd->title_list->title_info[title_idx].mpls_id,
-                           bd->title_list->title_info[title_idx].name);
+                           bd->title_list->title_info[title_idx].name,
+                           angle);
 }
 
-BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist)
+BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
 {
     char *f_name = str_printf("%05d.mpls", playlist);
     BLURAY_TITLE_INFO *title_info;
 
-    title_info = _get_title_info(bd, 0, playlist, f_name);
+    title_info = _get_title_info(bd, 0, playlist, f_name, angle);
 
     X_FREE(f_name);
 
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 15a6ee6..43b9c43 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -184,9 +184,10 @@ uint32_t bd_get_titles(BLURAY *bd, uint8_t flags);
  *
  * @param bd  BLURAY object
  * @param title_idx title index number
+ * @param angle angle number (chapter offsets and clip size depend on selected angle)
  * @return allocated BLURAY_TITLE_INFO object, NULL on error
  */
-BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx);
+BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle);
 
 /**
  *
@@ -194,9 +195,10 @@ BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx);
  *
  * @param bd  BLURAY object
  * @param playlist playlist number
+ * @param angle angle number (chapter offsets and clip size depend on selected angle)
  * @return allocated BLURAY_TITLE_INFO object, NULL on error
  */
-BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist);
+BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle);
 
 /**
  *



More information about the libbluray-devel mailing list