summaryrefslogtreecommitdiff
path: root/libavcodec/truehd_core_bsf.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-05-04 22:10:40 -0300
committerJames Almer <jamrial@gmail.com>2019-05-05 12:30:18 -0300
commitfcc01ba36a7a35d4e962f0e2a2a4739e890ba5cf (patch)
tree1f454a508cc515ed8ca076db72600696366f4f2c /libavcodec/truehd_core_bsf.c
parent38baaa1617d8ba93fb2325f29350a09528904935 (diff)
avcodec/truehd_core: reset state when flushing
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/truehd_core_bsf.c')
-rw-r--r--libavcodec/truehd_core_bsf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/truehd_core_bsf.c b/libavcodec/truehd_core_bsf.c
index dd40e1e0c3..309e6624ac 100644
--- a/libavcodec/truehd_core_bsf.c
+++ b/libavcodec/truehd_core_bsf.c
@@ -174,6 +174,12 @@ fail:
return ret;
}
+static void truehd_core_flush(AVBSFContext *ctx)
+{
+ TrueHDCoreContext *s = ctx->priv_data;
+ memset(&s->hdr, 0, sizeof(s->hdr));
+}
+
static const enum AVCodecID codec_ids[] = {
AV_CODEC_ID_TRUEHD, AV_CODEC_ID_NONE,
};
@@ -182,5 +188,6 @@ const AVBitStreamFilter ff_truehd_core_bsf = {
.name = "truehd_core",
.priv_data_size = sizeof(TrueHDCoreContext),
.filter = truehd_core_filter,
+ .flush = truehd_core_flush,
.codec_ids = codec_ids,
};