Commit cf6d3c25 authored by hpi1's avatar hpi1

load disc index (index.bdmv) in bd_open()

parent a1c695bb
......@@ -23,6 +23,8 @@
#include "file/dl.h"
#include "libbdnav/navigation.h"
#include "libbdnav/index_parse.h"
static int _open_m2ts(BLURAY *bd)
{
char *f_name;
......@@ -97,6 +99,20 @@ static int _libaacs_open(BLURAY *bd, const char *keyfile_path)
return 0;
}
int _index_open(BLURAY *bd)
{
char *file;
file = str_printf("%s/BDMV/index.bdmv", bd->device_path);
bd->index = indx_parse(file);
X_FREE(file);
if (!bd->index) {
return 0;
}
return 1;
}
BLURAY *bd_open(const char* device_path, const char* keyfile_path)
{
BLURAY *bd = calloc(1, sizeof(BLURAY));
......@@ -148,7 +164,7 @@ BLURAY *bd_open(const char* device_path, const char* keyfile_path)
X_FREE(tmp);
}
_index_open(bd);
DEBUG(DBG_BLURAY, "BLURAY initialized! (%p)\n", bd);
} else {
......@@ -191,6 +207,9 @@ void bd_close(BLURAY *bd)
if (bd->title != NULL) {
nav_title_close(bd->title);
}
if (bd->index != NULL) {
indx_free(bd->index);
}
X_FREE(bd->device_path);
......
......@@ -8,6 +8,8 @@
#include "file/file.h"
#include "libbdnav/navigation.h"
struct indx_root_s;
typedef int (*fptr_int)();
typedef int32_t (*fptr_int32)();
typedef void* (*fptr_p_void)();
......@@ -36,6 +38,8 @@ struct bluray {
uint32_t angle_change_time;
int request_angle;
int angle;
struct indx_root_s *index;
};
typedef struct bd_chapter {
......
......@@ -76,7 +76,7 @@ typedef struct {
};
} INDX_TITLE;
typedef struct {
typedef struct indx_root_s {
INDX_APP_INFO app_info;
INDX_PLAY_ITEM first_play;
INDX_PLAY_ITEM top_menu;
......
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