summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2018-12-05 19:02:03 +0100
committerAnton Kindestam <antonki@kth.se>2018-12-05 19:19:24 +0100
commit8b83c8996686072bc743b112ae5cb3bf93aa33ed (patch)
treeb09ce6a7ff470b05006622f19914b3d39d2f7d9f /common
parent5bcac8580df6fc62323136f756a3a6d1e754fe9c (diff)
parent559a400ac36e75a8d73ba263fd7fa6736df1c2da (diff)
downloadmpv-8b83c8996686072bc743b112ae5cb3bf93aa33ed.tar.bz2
mpv-8b83c8996686072bc743b112ae5cb3bf93aa33ed.tar.xz
Merge commit '559a400ac36e75a8d73ba263fd7fa6736df1c2da' into wm4-commits--merge-edition
This bumps libmpv version to 1.103
Diffstat (limited to 'common')
-rw-r--r--common/global.h5
-rw-r--r--common/msg.c11
-rw-r--r--common/msg_control.h3
-rw-r--r--common/playlist.c7
-rw-r--r--common/playlist.h4
5 files changed, 12 insertions, 18 deletions
diff --git a/common/global.h b/common/global.h
index 879ca72386..f6f83cf68c 100644
--- a/common/global.h
+++ b/common/global.h
@@ -8,10 +8,7 @@ struct mpv_global {
struct mp_log *log;
struct m_config_shadow *config;
struct mp_client_api *client_api;
-
- // Using this is deprecated and should be avoided (missing synchronization).
- // Use m_config_cache to access mpv_global.config instead.
- struct MPOpts *opts;
+ char *configdir;
};
#endif
diff --git a/common/msg.c b/common/msg.c
index b8e89bec31..cb41ea4168 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -460,8 +460,6 @@ void mp_msg_init(struct mpv_global *global)
struct mp_log *log = mp_log_new(root, &dummy, "");
global->log = log;
-
- mp_msg_update_msglevels(global);
}
// If opt is different from *current_path, reopen *file and update *current_path.
@@ -501,13 +499,9 @@ static void reopen_file(char *opt, char **current_path, FILE **file,
talloc_free(tmp);
}
-void mp_msg_update_msglevels(struct mpv_global *global)
+void mp_msg_update_msglevels(struct mpv_global *global, struct MPOpts *opts)
{
struct mp_log_root *root = global->log->root;
- struct MPOpts *opts = global->opts;
-
- if (!opts)
- return;
pthread_mutex_lock(&mp_msg_lock);
@@ -522,8 +516,7 @@ void mp_msg_update_msglevels(struct mpv_global *global)
}
m_option_type_msglevels.free(&root->msg_levels);
- m_option_type_msglevels.copy(NULL, &root->msg_levels,
- &global->opts->msg_levels);
+ m_option_type_msglevels.copy(NULL, &root->msg_levels, &opts->msg_levels);
atomic_fetch_add(&root->reload_counter, 1);
pthread_mutex_unlock(&mp_msg_lock);
diff --git a/common/msg_control.h b/common/msg_control.h
index 4b67190155..1e41191f6f 100644
--- a/common/msg_control.h
+++ b/common/msg_control.h
@@ -4,9 +4,10 @@
#include <stdbool.h>
struct mpv_global;
+struct MPOpts;
void mp_msg_init(struct mpv_global *global);
void mp_msg_uninit(struct mpv_global *global);
-void mp_msg_update_msglevels(struct mpv_global *global);
+void mp_msg_update_msglevels(struct mpv_global *global, struct MPOpts *opts);
void mp_msg_force_stderr(struct mpv_global *global, bool force_stderr);
bool mp_msg_has_status_line(struct mpv_global *global);
bool mp_msg_has_log_file(struct mpv_global *global);
diff --git a/common/playlist.c b/common/playlist.c
index b2b297d671..7572e67780 100644
--- a/common/playlist.c
+++ b/common/playlist.c
@@ -275,13 +275,14 @@ struct playlist_entry *playlist_entry_from_index(struct playlist *pl, int index)
}
}
-struct playlist *playlist_parse_file(const char *file, struct mpv_global *global)
+struct playlist *playlist_parse_file(const char *file, struct mp_cancel *cancel,
+ struct mpv_global *global)
{
struct mp_log *log = mp_log_new(NULL, global->log, "!playlist_parser");
mp_verbose(log, "Parsing playlist file %s...\n", file);
struct demuxer_params p = {.force_format = "playlist"};
- struct demuxer *d = demux_open_url(file, &p, NULL, global);
+ struct demuxer *d = demux_open_url(file, &p, cancel, global);
if (!d) {
talloc_free(log);
return NULL;
@@ -296,7 +297,7 @@ struct playlist *playlist_parse_file(const char *file, struct mpv_global *global
"pass it to the player\ndirectly. Don't use --playlist.\n");
}
}
- free_demuxer_and_stream(d);
+ demux_free(d);
if (ret) {
mp_verbose(log, "Playlist successfully parsed\n");
diff --git a/common/playlist.h b/common/playlist.h
index d35fff6df3..a37c516519 100644
--- a/common/playlist.h
+++ b/common/playlist.h
@@ -101,8 +101,10 @@ int playlist_entry_to_index(struct playlist *pl, struct playlist_entry *e);
int playlist_entry_count(struct playlist *pl);
struct playlist_entry *playlist_entry_from_index(struct playlist *pl, int index);
+struct mp_cancel;
struct mpv_global;
-struct playlist *playlist_parse_file(const char *file, struct mpv_global *global);
+struct playlist *playlist_parse_file(const char *file, struct mp_cancel *cancel,
+ struct mpv_global *global);
void playlist_entry_unref(struct playlist_entry *e);