Commit 80779fae authored by hpi1's avatar hpi1

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

parent e8e400a9
......@@ -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;
......
......@@ -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",
......
......@@ -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,
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
/**
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment