summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-07 20:25:48 +0200
committerwm4 <wm4@nowhere>2014-06-07 20:25:48 +0200
commitfca608ccb95e4167e1885483dfd30ba71007cbb4 (patch)
tree92692bcc28a9302c7f84aaeb300bca9b6e522c0e /player
parent0b9468f65f6014b888cdb1c5c473569ca8d9c57f (diff)
downloadmpv-fca608ccb95e4167e1885483dfd30ba71007cbb4.tar.bz2
mpv-fca608ccb95e4167e1885483dfd30ba71007cbb4.tar.xz
client API: rename mpv_destroy() to mpv_detach_destroy()
A bit verbose, but less misleading. In most cases, the API user probably actually wants mpv_terminate_destroy() instead, so the less-useful function shouldn't have a simnpler name anyway.
Diffstat (limited to 'player')
-rw-r--r--player/client.c7
-rw-r--r--player/scripting.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/player/client.c b/player/client.c
index 9a984052b1..fcee36a383 100644
--- a/player/client.c
+++ b/player/client.c
@@ -255,7 +255,7 @@ static void unlock_core(mpv_handle *ctx)
mp_dispatch_unlock(ctx->mpctx->dispatch);
}
-void mpv_destroy(mpv_handle *ctx)
+void mpv_detach_destroy(mpv_handle *ctx)
{
if (!ctx)
return;
@@ -292,7 +292,6 @@ void mpv_destroy(mpv_handle *ctx)
// shutdown_clients() sleeps to avoid wasting CPU
if (clients->mpctx->input)
mp_input_wakeup(clients->mpctx->input);
- // TODO: make core quit if there are no clients
break;
}
}
@@ -310,7 +309,7 @@ void mpv_terminate_destroy(mpv_handle *ctx)
mpv_command(ctx, (const char*[]){"quit", NULL});
if (!ctx->owner) {
- mpv_destroy(ctx);
+ mpv_detach_destroy(ctx);
return;
}
@@ -322,7 +321,7 @@ void mpv_terminate_destroy(mpv_handle *ctx)
pthread_t playthread;
mp_dispatch_run(ctx->mpctx->dispatch, get_thread, &playthread);
- mpv_destroy(ctx);
+ mpv_detach_destroy(ctx);
// And this is also the reason why we only allow 1 thread (the owner) to
// call this function.
diff --git a/player/scripting.c b/player/scripting.c
index f866a0eaf4..5f072be1ca 100644
--- a/player/scripting.c
+++ b/player/scripting.c
@@ -84,7 +84,7 @@ static void *script_thread(void *p)
mp_verbose(log, "Exiting...\n");
- mpv_destroy(arg->client);
+ mpv_detach_destroy(arg->client);
talloc_free(arg);
return NULL;
}