Commit ef475eb9 by cdrolle Committed by Oliver Woodman

Fixed potential bug in which old paint-on captions could be drawn overtop by…

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
parent 9e07cf7c
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment