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:
wm4 2016-06-23 12:07:05 +02:00
parent c071c30bcd
commit 5c74da4503
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}