[FFmpeg-devel] [PATCH] libavcodec/h263dec.c: Duplicate the last decoded frame when xvid marks the packet as skipped.

Thierry Foucu tfoucu at gmail.com
Thu Oct 19 19:51:05 EEST 2017


Instead of returning nothing when we detect the xvid skipped frame, we
could return the last decoded frame, if we do have one.
---
 libavcodec/h263dec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index bcb2b08bb0..e1667bcbc1 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -507,8 +507,15 @@ retry:
                 s->height= avctx->coded_height;
         }
     }
-    if (ret == FRAME_SKIPPED)
+    if (ret == FRAME_SKIPPED) {
+        if (s->next_picture_ptr) {
+            if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) {
+                return ret;
+            }
+            *got_frame = 1;
+        }
         return get_consumed_bytes(s, buf_size);
+    }
 
     /* skip if the header was thrashed */
     if (ret < 0) {
-- 
2.15.0.rc1.287.g2b38de12cc-goog



More information about the ffmpeg-devel mailing list