Commit 8014175c authored by j45's avatar j45

- fix main title selection when there is only one playlist

- dynamically allocate root path to allow for longer paths
parent 7cd4a904
......@@ -146,7 +146,7 @@ char* nav_find_main_title(char *root)
if (_filter_dup(pl_list, ii, pl) &&
_filter_repeats(pl, 2)) {
pl_list[ii] = pl;
if (_pl_duration(pl_list[ii]) > _pl_duration(pl_list[jj])) {
if (_pl_duration(pl_list[ii]) >= _pl_duration(pl_list[jj])) {
strncpy(longest, ent.d_name, 11);
longest[10] = '\0';
jj = ii;
......@@ -246,8 +246,7 @@ NAV_TITLE* nav_title_open(char *root, char *playlist)
if (title == NULL) {
return NULL;
}
strncpy(title->root, root, 1024);
title->root[1023] = '\0';
title->root = strdup(root);
strncpy(title->name, playlist, 11);
title->name[10] = '\0';
path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST" DIR_SEP "%s",
......@@ -324,6 +323,7 @@ void nav_title_close(NAV_TITLE *title)
clpi_free(title->clip_list.clip[ii].cl);
}
X_FREE(title->clip_list.clip);
X_FREE(title->root);
X_FREE(title);
}
......
......@@ -48,7 +48,7 @@ typedef struct {
} NAV_CLIP_LIST;
typedef struct {
char root[1024];
char *root;
char name[11];
uint8_t angle;
NAV_CLIP_LIST clip_list;
......
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