mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-26 04:40:20 +00:00
m_config: add custom context to includefunc callback
This commit is contained in:
@@ -64,7 +64,7 @@ static int parse_include(struct m_config *config, struct bstr param, bool set,
|
||||
if (!set)
|
||||
return 1;
|
||||
char *filename = bstrdup0(NULL, param);
|
||||
config->includefunc(config, filename, flags);
|
||||
config->includefunc(config->includefunc_ctx, filename, flags);
|
||||
talloc_free(filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,8 @@ typedef struct m_config {
|
||||
|
||||
bool use_profiles;
|
||||
bool is_toplevel;
|
||||
int (*includefunc)(struct m_config *conf, char *filename, int flags);
|
||||
int (*includefunc)(void *ctx, char *filename, int flags);
|
||||
void *includefunc_ctx;
|
||||
|
||||
void *optstruct; // struct mpopts or other
|
||||
} m_config_t;
|
||||
|
||||
Reference in New Issue
Block a user