Browse code

Apply clut changes only to one table.

The specification does not allow multiple bits to be set,
but some encoders do it anyway.
Applying it only to the first seems to give better results.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>

JULIAN GARDNER authored on 2013/09/05 06:51:34
Showing 1 changed files
... ...
@@ -1015,9 +1015,9 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
1015 1015
 
1016 1016
         if (depth & 0x80)
1017 1017
             clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
1018
-        if (depth & 0x40)
1018
+        else if (depth & 0x40)
1019 1019
             clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
1020
-        if (depth & 0x20)
1020
+        else if (depth & 0x20)
1021 1021
             clut->clut256[entry_id] = RGBA(r,g,b,255 - alpha);
1022 1022
     }
1023 1023
     }