changeset 584:03e395b31197 libavcodec

handle DRI/RST markers patch by Leon van Stuivenberg <leonvs at iae dot nl>
author michaelni
date Sat, 27 Jul 2002 08:27:02 +0000
parents d6955d0d7d27
children 86ebb02c6693
files mjpeg.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mjpeg.c	Sat Jul 27 03:08:04 2002 +0000
+++ b/mjpeg.c	Sat Jul 27 08:27:02 2002 +0000
@@ -1004,6 +1004,12 @@
                     }
                 }
             }
+            if (s->restart_interval && !--s->restart_count) {
+                align_get_bits(&s->gb);
+                skip_bits(&s->gb, 16); /* skip RSTn */
+                for (j=0; j<nb_components; j++) /* reset dc */
+                    s->last_dc[j] = 1024;
+            }
         }
     }
     ret = 0;
@@ -1156,12 +1162,15 @@
 
     state = *header_state;
     buf_ptr = *pbuf_ptr;
+retry:
     if (state) {
         /* get marker */
     found:
         if (buf_ptr < buf_end) {
             val = *buf_ptr++;
             state = 0;
+            if ((val >= RST0) && (val <= RST7))
+                goto retry;
         } else {
             val = -1;
         }