[FFmpeg-devel] [PATCH v5 1/4] lavc/libdavs2: fix sequence incomplete output error

hwren hwrenx at 126.com
Thu Nov 15 09:48:29 EET 2018


Any comments on these patches?








At 2018-11-02 21:30:08, "hwren" <hwrenx at 126.com> wrote:
>Signed-off-by: hwren <hwrenx at 126.com>
>---
> libavcodec/libdavs2.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
>diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
>index cadf995..e36bfed 100644
>--- a/libavcodec/libdavs2.c
>+++ b/libavcodec/libdavs2.c
>@@ -129,7 +129,17 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data,
>     int           ret      = DAVS2_DEFAULT;
> 
>     if (!buf_size) {
>-        return 0;
>+        ret = davs2_decoder_flush(cad->decoder, &cad->headerset, &cad->out_frame);
>+        if (ret == DAVS2_END) {
>+            return 0;
>+        } else if (ret == DAVS2_GOT_FRAME) {
>+            *got_frame = davs2_dump_frames(avctx, &cad->out_frame, &cad->headerset, ret, frame);
>+            davs2_decoder_frame_unref(cad->decoder, &cad->out_frame);
>+            return ret;
>+        } else {
>+            av_log(avctx, AV_LOG_ERROR, "Decoder error: dump frames failed\n");
>+            return AVERROR_EXTERNAL;
>+        }
>     }
> 
>     cad->packet.data = buf_ptr;
>-- 
>2.7.4


More information about the ffmpeg-devel mailing list