summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/input.rst4
-rw-r--r--input/cmd_list.c2
-rw-r--r--input/cmd_list.h2
-rw-r--r--player/command.c10
4 files changed, 18 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index ea408d00ed..9df19b7ba3 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -556,6 +556,10 @@ Input Commands that are Possibly Subject to Change
those which can will be reset even if they don't appear in the argument.
This command might be changed or removed in the future.
+``drop_buffers``
+ Drop audio/video/demuxer buffers, and restart from fresh. Might help with
+ unseekable streams that are going out of sync.
+ This command might be changed or removed in the future.
Undocumented commands: ``tv_last_channel`` (TV/DVB only), ``get_property`` (?),
``ao_reload`` (experimental/internal).
diff --git a/input/cmd_list.c b/input/cmd_list.c
index b513ff48ab..c1413f7dd9 100644
--- a/input/cmd_list.c
+++ b/input/cmd_list.c
@@ -157,6 +157,8 @@ const struct mp_cmd_def mp_cmds[] = {
{ MP_CMD_AB_LOOP, "ab_loop", },
+ { MP_CMD_DROP_BUFFERS, "drop_buffers", },
+
{ MP_CMD_AF, "af", { ARG_STRING, ARG_STRING } },
{ MP_CMD_AO_RELOAD, "ao_reload", },
diff --git a/input/cmd_list.h b/input/cmd_list.h
index 8dc754c774..638fc5bb68 100644
--- a/input/cmd_list.h
+++ b/input/cmd_list.h
@@ -80,6 +80,8 @@ enum mp_command_type {
MP_CMD_AB_LOOP,
+ MP_CMD_DROP_BUFFERS,
+
/// Audio Filter commands
MP_CMD_AF,
MP_CMD_AO_RELOAD,
diff --git a/player/command.c b/player/command.c
index 0559221322..d9a0d99745 100644
--- a/player/command.c
+++ b/player/command.c
@@ -4440,6 +4440,16 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
return r > 0;
}
+ case MP_CMD_DROP_BUFFERS: {
+ reset_audio_state(mpctx);
+ reset_video_state(mpctx);
+
+ if (mpctx->demuxer)
+ demux_flush(mpctx->demuxer);
+
+ break;
+ }
+
case MP_CMD_VO_CMDLINE:
if (mpctx->video_out) {
char *s = cmd->args[0].v.s;