+static void davs2_flush(AVCodecContext *avctx)
+{
+ DAVS2Context *cad = avctx->priv_data;
+ int ret = DAVS2_GOT_FRAME;
+
+ while (ret == DAVS2_GOT_FRAME) {
+ ret = davs2_decoder_flush(cad->decoder, &cad->headerset, &cad->out_frame);
+ davs2_decoder_frame_unref(cad->decoder, &cad->out_frame);
+ }
+
+ if (ret == DAVS2_ERROR) {
+ av_log(avctx, AV_LOG_WARNING, "Decoder flushing failed.\n");
+ }
+}
+