diff options
author | Leon van Stuivenberg <leonvs@iae.nl> | 2002-07-27 08:27:02 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-07-27 08:27:02 +0000 |
commit | d6afa9c67176c7102b4ce71cca9c3bc64c5a781a (patch) | |
tree | f426cf5ca9e9cd97d9a04c0532e2a1365b332004 | |
parent | ce8389779605461dbc0d559c9edfeefbafd73336 (diff) | |
download | ffmpeg-d6afa9c67176c7102b4ce71cca9c3bc64c5a781a.tar.gz |
handle DRI/RST markers patch by Leon van Stuivenberg <leonvs at iae dot nl>
Originally committed as revision 826 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mjpeg.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 5beb47e17d..c4ebee634a 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -1004,6 +1004,12 @@ static int mjpeg_decode_sos(MJpegDecodeContext *s, } } } + 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 @@ static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end, 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; } |