diff mbox

[FFmpeg-devel] avcodec/arbc: clear decoder state when seeking

Message ID 20190128162019.1172-1-jamrial@gmail.com
State Accepted
Commit 286e58bb1f2d14bc2652430413987554e4e71668
Headers show

Commit Message

James Almer Jan. 28, 2019, 4:20 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/arbc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Paul B Mahol Jan. 28, 2019, 6:38 p.m. UTC | #1
On 1/28/19, James Almer <jamrial@gmail.com> wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/arbc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
> index 01a146f934..4558304f12 100644
> --- a/libavcodec/arbc.c
> +++ b/libavcodec/arbc.c
> @@ -181,6 +181,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
>      return 0;
>  }
>
> +static void decode_flush(AVCodecContext *avctx)
> +{
> +    ARBCContext *s = avctx->priv_data;
> +
> +    av_frame_unref(s->prev_frame);
> +}
> +
>  static av_cold int decode_close(AVCodecContext *avctx)
>  {
>      ARBCContext *s = avctx->priv_data;
> @@ -198,6 +205,7 @@ AVCodec ff_arbc_decoder = {
>      .priv_data_size = sizeof(ARBCContext),
>      .init           = decode_init,
>      .decode         = decode_frame,
> +    .flush          = decode_flush,
>      .close          = decode_close,
>      .capabilities   = AV_CODEC_CAP_DR1,
>      .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
> --
> 2.20.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Probably ok
diff mbox

Patch

diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
index 01a146f934..4558304f12 100644
--- a/libavcodec/arbc.c
+++ b/libavcodec/arbc.c
@@ -181,6 +181,13 @@  static av_cold int decode_init(AVCodecContext *avctx)
     return 0;
 }
 
+static void decode_flush(AVCodecContext *avctx)
+{
+    ARBCContext *s = avctx->priv_data;
+
+    av_frame_unref(s->prev_frame);
+}
+
 static av_cold int decode_close(AVCodecContext *avctx)
 {
     ARBCContext *s = avctx->priv_data;
@@ -198,6 +205,7 @@  AVCodec ff_arbc_decoder = {
     .priv_data_size = sizeof(ARBCContext),
     .init           = decode_init,
     .decode         = decode_frame,
+    .flush          = decode_flush,
     .close          = decode_close,
     .capabilities   = AV_CODEC_CAP_DR1,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,