From 2c305d5b2990d31911d7faa4c9117bf4eb89c88b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Feb 2015 20:06:43 +0100 Subject: player: cosmetics: async/non-blocking -> reentrant These functions do blocking work on a separate thread, but wait until they return. So they are not async or non-blocking. But they do react to user-input and client API accesses, which makes them reentrant. --- player/loadfile.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index bbfff46fe2..f74cd49d32 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -939,8 +939,8 @@ static void open_stream_thread(void *pctx) args->cancel, args->global); } -static struct stream *open_stream_async(struct MPContext *mpctx, - char *filename, int stream_flags) +static struct stream *open_stream_reentrant(struct MPContext *mpctx, + char *filename, int stream_flags) { struct stream_open_args args = { .cancel = mpctx->playback_abort, @@ -948,7 +948,7 @@ static struct stream *open_stream_async(struct MPContext *mpctx, .filename = filename, .stream_flags = stream_flags, }; - mpctx_run_non_blocking(mpctx, open_stream_thread, &args); + mpctx_run_reentrant(mpctx, open_stream_thread, &args); if (args.stream) { talloc_steal(args.stream, args.global); } else { @@ -971,11 +971,11 @@ static void open_demux_thread(void *pctx) args->demux = demux_open(s, global->opts->demuxer_name, NULL, global); } -static struct demuxer *open_demux_async(struct MPContext *mpctx, - struct stream *stream) +static struct demuxer *open_demux_reentrant(struct MPContext *mpctx, + struct stream *stream) { struct demux_open_args args = {stream, create_sub_global(mpctx)}; - mpctx_run_non_blocking(mpctx, open_demux_thread, &args); + mpctx_run_reentrant(mpctx, open_demux_thread, &args); if (args.demux) { talloc_steal(args.demux, args.global); } else { @@ -1086,8 +1086,8 @@ static void play_current_file(struct MPContext *mpctx) int stream_flags = STREAM_READ; if (!opts->load_unsafe_playlists) stream_flags |= mpctx->playing->stream_flags; - mpctx->stream = open_stream_async(mpctx, mpctx->stream_open_filename, - stream_flags); + mpctx->stream = open_stream_reentrant(mpctx, mpctx->stream_open_filename, + stream_flags); if (!mpctx->stream) goto terminate_playback; @@ -1113,7 +1113,7 @@ goto_reopen_demuxer: ; mp_nav_reset(mpctx); - mpctx->demuxer = open_demux_async(mpctx, mpctx->stream); + mpctx->demuxer = open_demux_reentrant(mpctx, mpctx->stream); if (!mpctx->demuxer) { MP_ERR(mpctx, "Failed to recognize file format.\n"); mpctx->error_playing = MPV_ERROR_UNKNOWN_FORMAT; -- cgit v1.2.3