diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-01 12:01:34 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-02 22:05:47 +0400 |
commit | c1dcbc590d90199b989095a722319fbf8851dce7 (patch) | |
tree | eb07a1487dd0525adbd44ac52bf0bdcf72c3377d /libavcodec | |
parent | 53d5d89c1b7534205e5f825918701dda56d18896 (diff) |
jpeg2000: Do not assume a single tile
In preparation of supporting multiple tiles.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 6a300bd8f5..d2974be432 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1327,12 +1327,18 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s) static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s) { int ret = 0; - Jpeg2000Tile *tile = s->tile + s->curtileno; + int tileno; - if (ret = init_tile(s, s->curtileno)) - return ret; - if (ret = jpeg2000_decode_packets(s, tile)) - return ret; + for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) { + Jpeg2000Tile *tile = s->tile + tileno; + + if (ret = init_tile(s, tileno)) + return ret; + + s->g = tile->tile_part[0].tpg; + if (ret = jpeg2000_decode_packets(s, tile)) + return ret; + } return 0; } |