diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/core.h | 1 | ||||
-rw-r--r-- | player/loadfile.c | 4 | ||||
-rw-r--r-- | player/misc.c | 17 |
3 files changed, 1 insertions, 21 deletions
diff --git a/player/core.h b/player/core.h index bdf19a815a..0ffb47404c 100644 --- a/player/core.h +++ b/player/core.h @@ -497,7 +497,6 @@ void error_on_track(struct MPContext *mpctx, struct track *track); int stream_dump(struct MPContext *mpctx, const char *source_filename); int mpctx_run_reentrant(struct MPContext *mpctx, void (*thread_fn)(void *arg), void *thread_arg); -struct mpv_global *create_sub_global(struct MPContext *mpctx); double get_track_seek_offset(struct MPContext *mpctx, struct track *track); // osd.c diff --git a/player/loadfile.c b/player/loadfile.c index b42b8f14e3..8f065e8d07 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -809,7 +809,7 @@ static void open_demux_thread(void *pctx) static void open_demux_reentrant(struct MPContext *mpctx) { struct demux_open_args args = { - .global = create_sub_global(mpctx), + .global = mpctx->global, .cancel = mpctx->playback_abort, .log = mpctx->log, .stream_flags = mpctx->playing->stream_flags, @@ -819,12 +819,10 @@ static void open_demux_reentrant(struct MPContext *mpctx) args.stream_flags = 0; mpctx_run_reentrant(mpctx, open_demux_thread, &args); if (args.demux) { - talloc_steal(args.demux, args.global); mpctx->demuxer = args.demux; enable_demux_thread(mpctx, mpctx->demuxer); } else { mpctx->error_playing = args.err; - talloc_free(args.global); } talloc_free(args.url); } diff --git a/player/misc.c b/player/misc.c index 62223ebfef..17232ff828 100644 --- a/player/misc.c +++ b/player/misc.c @@ -251,23 +251,6 @@ void merge_playlist_files(struct playlist *pl) talloc_free(edl); } -// Create a talloc'ed copy of mpctx->global. It contains a copy of the global -// option struct. It still just references some things though, like mp_log. -// The main purpose is letting threads access the option struct without the -// need for additional synchronization. -struct mpv_global *create_sub_global(struct MPContext *mpctx) -{ - struct mpv_global *new = talloc_ptrtype(NULL, new); - struct m_config *new_config = m_config_dup(new, mpctx->mconfig); - *new = (struct mpv_global){ - .log = mpctx->global->log, - .config = mpctx->global->config, - .opts = new_config->optstruct, - .client_api = mpctx->clients, - }; - return new; -} - struct wrapper_args { struct MPContext *mpctx; void (*thread_fn)(void *); |