diff options
author | Matt A. Tobin <email@mattatobin.com> | 2022-06-07 20:20:19 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2022-06-07 20:20:19 -0500 |
commit | 878ab758d5d4c1ef7badf2bc20ebc7c67dc2165b (patch) | |
tree | 3683d6df35e3618c0e7b456de7c749ca4c8c21a6 /libs/ffvpx/libavcodec/bsf.c | |
parent | a621951327b0c19c0c24dfd9fd973f7bd13ae68f (diff) | |
parent | cfb9884423faf741de03c5fcc72bf9ac8c6ada4d (diff) | |
download | aura-central-878ab758d5d4c1ef7badf2bc20ebc7c67dc2165b.tar.gz |
Merge branch 'TRUNK' into ARE-5.0
Diffstat (limited to 'libs/ffvpx/libavcodec/bsf.c')
-rw-r--r-- | libs/ffvpx/libavcodec/bsf.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libs/ffvpx/libavcodec/bsf.c b/libs/ffvpx/libavcodec/bsf.c index bd611ea16..e17dc854f 100644 --- a/libs/ffvpx/libavcodec/bsf.c +++ b/libs/ffvpx/libavcodec/bsf.c @@ -47,7 +47,8 @@ void av_bsf_free(AVBSFContext **pctx) av_opt_free(ctx); - av_packet_free(&ctx->internal->buffer_pkt); + if (ctx->internal) + av_packet_free(&ctx->internal->buffer_pkt); av_freep(&ctx->internal); av_freep(&ctx->priv_data); @@ -172,6 +173,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; @@ -340,6 +351,15 @@ static int bsf_list_filter(AVBSFContext *bsf, AVPacket *out) return ret; } +static void bsf_list_flush(AVBSFContext *bsf) +{ + BSFListContext *lst = bsf->priv_data; + + for (int i = 0; i < lst->nb_bsfs; i++) + av_bsf_flush(lst->bsfs[i]); + lst->idx = lst->flushed_idx = 0; +} + static void bsf_list_close(AVBSFContext *bsf) { BSFListContext *lst = bsf->priv_data; @@ -388,6 +408,7 @@ const AVBitStreamFilter ff_list_bsf = { .priv_class = &bsf_list_class, .init = bsf_list_init, .filter = bsf_list_filter, + .flush = bsf_list_flush, .close = bsf_list_close, }; |