Commit 11edeefa authored by hpi1's avatar hpi1

Added initial title to nav_title_open()

parent 33406576
......@@ -440,7 +440,7 @@ static void _fill_clip(NAV_TITLE *title,
*time += clip->out_time - clip->in_time;
}
NAV_TITLE* nav_title_open(const char *root, const char *playlist)
NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle)
{
NAV_TITLE *title = NULL;
char *path;
......@@ -459,7 +459,7 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist)
path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST" DIR_SEP "%s",
root, playlist);
title->angle_count = 0;
title->angle = 0;
title->angle = angle;
title->pl = mpls_parse(path, 0);
if (title->pl == NULL) {
BD_DEBUG(DBG_NAV, "Fail: Playlist parse %s\n", path);
......@@ -521,6 +521,11 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist)
title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));
_extrapolate_title(title);
if (title->angle >= title->angle_count) {
title->angle = 0;
}
return title;
}
......
......@@ -137,7 +137,7 @@ struct nav_title_list_s
BD_PRIVATE uint8_t nav_lookup_aspect(NAV_CLIP *clip, int pid);
BD_PRIVATE char* nav_find_main_title(const char *root);
BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist);
BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle);
BD_PRIVATE void nav_title_close(NAV_TITLE *title);
BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip);
BD_PRIVATE NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
......
......@@ -1309,11 +1309,11 @@ static void _close_playlist(BLURAY *bd)
}
}
static int _open_playlist(BLURAY *bd, const char *f_name)
static int _open_playlist(BLURAY *bd, const char *f_name, unsigned angle)
{
_close_playlist(bd);
bd->title = nav_title_open(bd->device_path, f_name);
bd->title = nav_title_open(bd->device_path, f_name, angle);
if (bd->title == NULL) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n",
f_name, bd);
......@@ -1357,7 +1357,7 @@ int bd_select_playlist(BLURAY *bd, uint32_t playlist)
}
}
result = _open_playlist(bd, f_name);
result = _open_playlist(bd, f_name, 0);
X_FREE(f_name);
return result;
......@@ -1383,7 +1383,7 @@ int bd_select_title(BLURAY *bd, uint32_t title_idx)
bd->title_idx = title_idx;
f_name = bd->title_list->title_info[title_idx].name;
return _open_playlist(bd, f_name);
return _open_playlist(bd, f_name, 0);
}
uint32_t bd_get_current_title(BLURAY *bd)
......@@ -1533,7 +1533,7 @@ static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32
NAV_TITLE *title;
BLURAY_TITLE_INFO *title_info;
title = nav_title_open(bd->device_path, mpls_name);
title = nav_title_open(bd->device_path, mpls_name, 0);
if (title == NULL) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n",
mpls_name, bd);
......
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