dvbsubdec: don't hardcode subtitle colors count in dvbsubdec to 16
authorJoakim Plate <elupus@ecce.se>
Sat, 10 Sep 2011 21:12:29 +0000 (23:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 21 Sep 2011 16:01:20 +0000 (18:01 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a3294ef0069c898a495c783dfdb2f0bf1dc6583)

libavcodec/dvbsubdec.c

index 5b09eb1..e43dd29 100644 (file)
@@ -1360,7 +1360,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
         rect->y = display->y_pos + offset_y;
         rect->w = region->width;
         rect->h = region->height;
-        rect->nb_colors = 16;
+        rect->nb_colors = (1 << region->depth);
         rect->type      = SUBTITLE_BITMAP;
         rect->pict.linesize[0] = region->width;