summaryrefslogtreecommitdiffstats
path: root/stream/stream_bluray.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_bluray.c')
-rw-r--r--stream/stream_bluray.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index 19e99a458b..7771375aa2 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -73,6 +73,20 @@
#define AACS_ERROR_MMC_FAILURE -7 /* MMC failed */
#define AACS_ERROR_NO_DK -8 /* no matching device key */
+
+struct bluray_opts {
+ char *bluray_device;
+};
+
+#define OPT_BASE_STRUCT struct bluray_opts
+const struct m_sub_options stream_bluray_conf = {
+ .opts = (const struct m_option[]) {
+ {"device", OPT_STRING(bluray_device), .flags = M_OPT_FILE},
+ {0},
+ },
+ .size = sizeof(struct bluray_opts),
+};
+
struct bluray_priv_s {
BLURAY *bd;
BLURAY_TITLE_INFO *title_info;
@@ -86,6 +100,8 @@ struct bluray_priv_s {
char *cfg_device;
bool use_nav;
+ struct bluray_opts *opts;
+ struct m_config_cache *opts_cache;
};
static void destruct(struct bluray_priv_s *priv)
@@ -377,8 +393,7 @@ static int bluray_stream_open_internal(stream_t *s)
if (b->cfg_device && b->cfg_device[0]) {
device = b->cfg_device;
} else {
- mp_read_option_raw(s->global, "bluray-device", &m_option_type_string,
- &device);
+ device = b->opts->bluray_device;
}
if (!device || !device[0]) {
@@ -466,6 +481,12 @@ static int bluray_stream_open(stream_t *s)
struct bluray_priv_s *b = talloc_zero(s, struct bluray_priv_s);
s->priv = b;
+ struct m_config_cache *opts_cache =
+ m_config_cache_alloc(s, s->global, &stream_bluray_conf);
+
+ b->opts_cache = opts_cache;
+ b->opts = opts_cache->opts;
+
b->use_nav = s->info == &stream_info_bdnav;
bstr title, bdevice, rest = { .len = 0 };