command: add playback-abort property

Now this is obscure.
This commit is contained in:
wm4 2014-10-21 13:32:30 +02:00
parent cdbc865ad0
commit 0fa9e2bff0
2 changed files with 13 additions and 0 deletions

View File

@ -1334,6 +1334,11 @@ Property list
``seekable``
Return whether it's generally possible to seek in the current file.
``playback-abort``
Return whether playback is stopped or is to be stopped. (Useful in obscure
situations like during ``on_load`` hook processing, when the user can
stop playback, but the script has to explicitly end processing.)
``osd-sym-cc``
Inserts the current OSD symbol as opaque OSD control code (cc). This makes
sense only with the ``show_text`` command or options which set OSD messages.

View File

@ -1157,6 +1157,13 @@ static int mp_property_seeking(void *ctx, struct m_property *prop,
return m_property_flag_ro(action, arg, !mpctx->restart_complete);
}
static int mp_property_playback_abort(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
return m_property_flag_ro(action, arg, !mpctx->playing || mpctx->stop_play);
}
static int mp_property_cache(void *ctx, struct m_property *prop,
int action, void *arg)
{
@ -2957,6 +2964,7 @@ static const struct m_property mp_properties[] = {
{"core-idle", mp_property_core_idle},
{"eof-reached", mp_property_eof_reached},
{"seeking", mp_property_seeking},
{"playback-abort", mp_property_playback_abort},
{"cache", mp_property_cache},
{"cache-free", mp_property_cache_free},
{"cache-used", mp_property_cache_used},