summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-20 22:41:50 +0100
committerwm4 <wm4@nowhere>2014-11-20 22:41:50 +0100
commit2d039e691f4f8f7b340a113fc9f69fa5bfa6193a (patch)
treec576d7153b2dda918ed25cdf7c129a321e67de10 /input
parent7df909e9fcc897083d4af53939ab392ca708f808 (diff)
downloadmpv-2d039e691f4f8f7b340a113fc9f69fa5bfa6193a.tar.bz2
mpv-2d039e691f4f8f7b340a113fc9f69fa5bfa6193a.tar.xz
command: add drop_buffers
This command was actually requested on IRC ages ago, but I forgot about it. The main purpose is that the decoding state can be reset without issuing a seek, in particular in situations where you can't seek. This restarts decoding from the middle of the packet stream; since it discards the packet buffer intentionally, and the decoder will typically not output "incomplete" frames until it has recovered, it can skip a large amount of data. It doesn't clear the byte stream cache - I'm not sure if it should.
Diffstat (limited to 'input')
-rw-r--r--input/cmd_list.c2
-rw-r--r--input/cmd_list.h2
2 files changed, 4 insertions, 0 deletions
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,