aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-14 23:30:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-15 00:53:59 +0100
commit1843e6c8aa9752aa7d500f8a2a0f072cf3a3aee0 (patch)
tree5a3731bc9160fd2ec4a3f4000c78a7c411268339 /libavcodec/mjpegdec.c
parent7a1723086a9cc72c2f3e1e682b002ed3d81990d3 (diff)
downloadffmpeg-1843e6c8aa9752aa7d500f8a2a0f072cf3a3aee0.tar.gz
thp: Fix handling of restart interval
Fixes Ticket903 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 64e5839231..d3bcb6fd27 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1048,6 +1048,12 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
if (s->restart_interval) {
s->restart_count--;
+ if(s->restart_count == 0 && s->avctx->codec_id == CODEC_ID_THP){
+ align_get_bits(&s->gb);
+ for (i = 0; i < nb_components; i++) /* reset dc */
+ s->last_dc[i] = 1024;
+ }
+
i = 8 + ((-get_bits_count(&s->gb)) & 7);
/* skip RSTn */
if (show_bits(&s->gb, i) == (1 << i) - 1) {