Fixed potential bug in which old paint-on captions could be drawn overtop by pop-on captions as they weren't being cleared properly.

This fix was taken from YouTube's Cea608Decoder ([]

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147066662
This commit is contained in:
cdrolle 2017-02-09 12:31:16 -08:00 committed by Oliver Woodman
parent 9e07cf7c73
commit ef475eb9c9

View file

@ -503,11 +503,14 @@ public final class Cea608Decoder extends CeaDecoder {
return;
}
int oldCaptionMode = this.captionMode;
this.captionMode = captionMode;
// Clear the working memory.
resetCueBuilders();
if (captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_UNKNOWN) {
// When switching to roll-up or unknown, we also need to clear the caption.
if (oldCaptionMode == CC_MODE_PAINT_ON || captionMode == CC_MODE_ROLL_UP
|| captionMode == CC_MODE_UNKNOWN) {
// When switching from paint-on or to roll-up or unknown, we also need to clear the caption.
cues = null;
}
}