diff options
author | Chong Zhang <chz@google.com> | 2015-02-11 02:35:07 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-11 02:35:08 +0000 |
commit | d6686a62f7c3379d1c0f7deba270b02dbe0a15e8 (patch) | |
tree | e8025e36db2a111c827257157fd3ac5b7878f9a7 | |
parent | 26c184b72329104ffa145e1bf45c6f66c9c42dce (diff) | |
parent | 56a7ed6982ce5100ed6fa5442931b2f39851a08c (diff) | |
download | frameworks_base-d6686a62f7c3379d1c0f7deba270b02dbe0a15e8.zip frameworks_base-d6686a62f7c3379d1c0f7deba270b02dbe0a15e8.tar.gz frameworks_base-d6686a62f7c3379d1c0f7deba270b02dbe0a15e8.tar.bz2 |
Merge "media: discard duplicate CEA-608 ctrl code"
-rw-r--r-- | media/java/android/media/ClosedCaptionRenderer.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/media/java/android/media/ClosedCaptionRenderer.java b/media/java/android/media/ClosedCaptionRenderer.java index d34b21b..e3680e9 100644 --- a/media/java/android/media/ClosedCaptionRenderer.java +++ b/media/java/android/media/ClosedCaptionRenderer.java @@ -154,6 +154,7 @@ class CCParser { private int mMode = MODE_PAINT_ON; private int mRollUpSize = 4; + private int mPrevCtrlCode = INVALID; private CCMemory mDisplay = new CCMemory(); private CCMemory mNonDisplay = new CCMemory(); @@ -260,6 +261,13 @@ class CCParser { private boolean handleCtrlCode(CCData ccData) { int ctrlCode = ccData.getCtrlCode(); + + if (mPrevCtrlCode != INVALID && mPrevCtrlCode == ctrlCode) { + // discard double ctrl codes (but if there's a 3rd one, we still take that) + mPrevCtrlCode = INVALID; + return true; + } + switch(ctrlCode) { case RCL: // select pop-on style @@ -325,10 +333,12 @@ class CCParser { break; case INVALID: default: - // not handled + mPrevCtrlCode = INVALID; return false; } + mPrevCtrlCode = ctrlCode; + // handled return true; } |