diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-09 23:45:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-09 23:45:31 +0200 |
commit | 1c032e94d0a529a424ffeb1fb7287c2c93d0be6a (patch) | |
tree | 8f69da58f081604eb5056ad0ab4205c17c141ae9 | |
parent | 776155ca29e7dfc2578ce5f3a7881e52e1ba2d54 (diff) | |
download | ffmpeg-1c032e94d0a529a424ffeb1fb7287c2c93d0be6a.tar.gz |
jpegdec: give handle_rstn() a return code that indicates if restart did happen
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mjpegdec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index ab4a6336e7..565580e8cb 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -736,9 +736,11 @@ static int decode_block_refinement(MJpegDecodeContext *s, int16_t *block, #undef REFINE_BIT #undef ZERO_RUN -static void handle_rstn(MJpegDecodeContext *s, int nb_components) +static int handle_rstn(MJpegDecodeContext *s, int nb_components) { int i; + int reset = 0; + if (s->restart_interval) { s->restart_count--; if(s->restart_count == 0 && s->avctx->codec_id == AV_CODEC_ID_THP){ @@ -759,11 +761,13 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components) if (get_bits_left(&s->gb) >= 8 && (get_bits(&s->gb, 8) & 0xF8) == 0xD0) { for (i = 0; i < nb_components; i++) /* reset dc */ s->last_dc[i] = 1024; + reset = 1; } else skip_bits_long(&s->gb, pos - get_bits_count(&s->gb)); } } } + return reset; } static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform) |