Skip to content

Commit

Permalink
libavcodec/dvbsubdec.c: set color to black if fully transparent
Browse files Browse the repository at this point in the history
If a dvbsub palette is transparent, force it to be black. Fixes color creep on the one DVB sample I have.
e7fdb7a
  • Loading branch information
ulmus-scott authored and bennettpeter committed Nov 27, 2021
1 parent 70fefd4 commit 54145fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mythtv/external/FFmpeg/libavcodec/dvbsubdec.c
Expand Up @@ -1132,6 +1132,12 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}

// MythTV added
if (alpha == 255)
{
r = g = b = 0;
}

if (depth & 0x80 && entry_id < 4)
clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
else if (depth & 0x40 && entry_id < 16)
Expand Down

0 comments on commit 54145fe

Please sign in to comment.