[FFmpeg-devel] Small modifcation to libavformat/dvbsubdec.c

JULIAN GARDNER joolzg at btinternet.com
Wed Sep 4 23:51:34 CEST 2013


diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 955925a..faa510a 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1015,9 +1015,9 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
 
         if (depth & 0x80)
             clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
-        if (depth & 0x40)
+        else if (depth & 0x40)
             clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
-        if (depth & 0x20)
+        else if (depth & 0x20)
             clut->clut256[entry_id] = RGBA(r,g,b,255 - alpha);
     }
     }


Just so it adheres to spec. Page 25 of ETS300743 V1.2.1, page 25.

2-bit/entry_CLUT_flag: If set to '1', this indicates that this CLUT value is to be loaded into the identified entry of the
2-bit/entry CLUT.  
4-bit/entry_CLUT_flag: If set to '1', this indicates that this CLUT value is to be loaded into the identified entry of the
4-bit/entry CLUT. 
8-bit/entry_CLUT_flag: If set to '1', this indicates that this CLUT value is to be loaded into the identified entry of the
8-bit/entry CLUT. 
NOTE 1: Only one N-bit/entry_CLUT_flag shall be set to 1 per CLUT_entry_id and its associated Y-, Cr-, Cb- and
T -values. 
joolz


More information about the ffmpeg-devel mailing list