mirror of
https://github.com/mpv-player/mpv
synced 2025-02-27 10:50:53 +00:00
af_lavcac3enc: implement flushing on seek
There's a lot of data that could have been buffered, and which has to be discarded.
This commit is contained in:
parent
c071c30bcd
commit
5c74da4503
@ -170,6 +170,13 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
s->input->samples = 0;
|
||||
return AF_OK;
|
||||
}
|
||||
case AF_CONTROL_RESET:
|
||||
if (avcodec_is_open(s->lavc_actx))
|
||||
avcodec_flush_buffers(s->lavc_actx);
|
||||
talloc_free(s->pending);
|
||||
s->pending = NULL;
|
||||
s->input->samples = 0;
|
||||
return AF_OK;
|
||||
}
|
||||
return AF_UNKNOWN;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user