aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bsf.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-07-26 20:32:13 -0300
committerJames Almer <jamrial@gmail.com>2018-08-16 23:43:10 -0300
commitb33f5299a59f5f155a4df5cb630b1de2acdb25b2 (patch)
tree35c60b6520607a44e92b46ca5f2abc155310966e /libavcodec/bsf.c
parentfe06ed22e6e0a8c2995818c4532eb6f4ec9320b9 (diff)
downloadffmpeg-b33f5299a59f5f155a4df5cb630b1de2acdb25b2.tar.gz
avcodec/bsf: add a flushing mechanism to AVBSFContext
Meant to reset the internal bsf state without the need to reinitialize it. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/bsf.c')
-rw-r--r--libavcodec/bsf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index bd611ea16b..03841da682 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -172,6 +172,16 @@ int av_bsf_init(AVBSFContext *ctx)
return 0;
}
+void av_bsf_flush(AVBSFContext *ctx)
+{
+ ctx->internal->eof = 0;
+
+ av_packet_unref(ctx->internal->buffer_pkt);
+
+ if (ctx->filter->flush)
+ ctx->filter->flush(ctx);
+}
+
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
{
int ret;