summaryrefslogtreecommitdiff
authorZhiwei Yan <zhiwei.yan@amlogic.com>2017-12-21 13:25:03 (GMT)
committer Zhiwei Yan <zhiwei.yan@amlogic.com>2017-12-22 06:02:56 (GMT)
commit7463a54c70708d5270f9242ffff756f0b3bf3900 (patch)
tree76399acf870d249f95ca5b6e8b986dfb22e1dc9d
parent913674ee410bd3449263d43b823267fc14f1d114 (diff)
downloadTvInput-7463a54c70708d5270f9242ffff756f0b3bf3900.zip
TvInput-7463a54c70708d5270f9242ffff756f0b3bf3900.tar.gz
TvInput-7463a54c70708d5270f9242ffff756f0b3bf3900.tar.bz2
DroidLogicTvInput: avoid to start subtitle again for av [1/3]
PD# 154509 avoid to start subtitle again when not select one Change-Id: I0299c7429db68caa6dfb327957c19a1c9892635f
Diffstat
-rw-r--r--DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV1InputService.java12
-rw-r--r--DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV2InputService.java12
2 files changed, 16 insertions, 8 deletions
diff --git a/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV1InputService.java b/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV1InputService.java
index e991519..0fc4f60 100644
--- a/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV1InputService.java
+++ b/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV1InputService.java
@@ -443,6 +443,9 @@ public class AV1InputService extends DroidLogicTvInputService {
Log.d(TAG, "ccc tryPrefer, exist["+exist+"] to["+to+"] Enable["+mCurrentCCEnabled+"]");
+ if (mCurrentCCStyle == to)//already show
+ return 0;
+
if (to != -1 && (mCurrentCCStyle != to)) {
mCurrentCCStyle = to;
startSubtitle();//startSubtitle(s);
@@ -458,7 +461,7 @@ public class AV1InputService extends DroidLogicTvInputService {
Log.d(TAG, "start bg cc for xds");
startSubtitle();
enableSubtitleShow(false);
- mCurrentCCStyle = -1;
+ //mCurrentCCStyle = -1;
//mSystemControlManager.setProperty(DTV_SUBTITLE_TRACK_IDX, "-3");
}
@@ -544,12 +547,13 @@ public class AV1InputService extends DroidLogicTvInputService {
return;
}
Log.d(TAG, "mCurrentCCStyle:"+mCurrentCCStyle);
- if (mCurrentCCStyle == -1) {
+ int temp = mCurrentCCStyle;
+ if (temp == -1) {
int ccPrefer = mSystemControlManager.getPropertyInt(DTV_SUBTITLE_CC_PREFER, -1);
- mCurrentCCStyle = ccPrefer > 0 ? ccPrefer : ChannelInfo.Subtitle.CC_CAPTION_CC1 ;
+ temp = ccPrefer > 0 ? ccPrefer : ChannelInfo.Subtitle.CC_CAPTION_VCHIP_ONLY;//parse xds vchip only
}
mSubtitleView.stop();
- setSubtitleParam(ChannelInfo.Subtitle.TYPE_ATV_CC, mCurrentCCStyle, 0, 0, 0);//we need xds data
+ setSubtitleParam(ChannelInfo.Subtitle.TYPE_ATV_CC, mCurrentCCStyle == -1 ? temp : mCurrentCCStyle, 0, 0, 0);//we need xds data
mSubtitleView.setActive(true);
mSubtitleView.startSub();
diff --git a/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV2InputService.java b/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV2InputService.java
index 6dc988e..db8798a 100644
--- a/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV2InputService.java
+++ b/DroidLogicTvInput/src/com/droidlogic/tvinput/services/AV2InputService.java
@@ -443,6 +443,9 @@ public class AV2InputService extends DroidLogicTvInputService {
Log.d(TAG, "ccc tryPrefer, exist["+exist+"] to["+to+"] Enable["+mCurrentCCEnabled+"]");
+ if (mCurrentCCStyle == to)//already show
+ return 0;
+
if (to != -1 && (mCurrentCCStyle != to)) {
mCurrentCCStyle = to;
startSubtitle();//startSubtitle(s);
@@ -458,7 +461,7 @@ public class AV2InputService extends DroidLogicTvInputService {
Log.d(TAG, "start bg cc for xds");
startSubtitle();
enableSubtitleShow(false);
- mCurrentCCStyle = -1;
+ //mCurrentCCStyle = -1;
//mSystemControlManager.setProperty(DTV_SUBTITLE_TRACK_IDX, "-3");
}
@@ -544,12 +547,13 @@ public class AV2InputService extends DroidLogicTvInputService {
return;
}
Log.d(TAG, "mCurrentCCStyle:"+mCurrentCCStyle);
- if (mCurrentCCStyle == -1) {
+ int temp = mCurrentCCStyle;
+ if (temp == -1) {
int ccPrefer = mSystemControlManager.getPropertyInt(DTV_SUBTITLE_CC_PREFER, -1);
- mCurrentCCStyle = ccPrefer > 0 ? ccPrefer : ChannelInfo.Subtitle.CC_CAPTION_CC1 ;
+ temp = ccPrefer > 0 ? ccPrefer : ChannelInfo.Subtitle.CC_CAPTION_VCHIP_ONLY;//parse xds vchip only
}
mSubtitleView.stop();
- setSubtitleParam(ChannelInfo.Subtitle.TYPE_ATV_CC, mCurrentCCStyle, 0, 0, 0);//we need xds data
+ setSubtitleParam(ChannelInfo.Subtitle.TYPE_ATV_CC, mCurrentCCStyle == -1 ? temp : mCurrentCCStyle, 0, 0, 0);//we need xds data
mSubtitleView.setActive(true);
mSubtitleView.startSub();