Fix surface bug

release
FongMi 2 years ago
parent fc3a4fb33b
commit bdde04120f
  1. 2
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/CastActivity.java
  2. 2
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  3. 2
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/VideoActivity.java
  4. 6
      app/src/main/java/com/fongmi/android/tv/player/Players.java
  5. 2
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  6. 2
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/VideoActivity.java

@ -343,7 +343,7 @@ public class CastActivity extends BaseActivity implements CustomKeyDownCast.List
}
private void checkError(ErrorEvent event) {
if (mPlayers.isHard() && event.getCode() / 1000 == 4) {
if (event.getCode() / 1000 == 4 && mPlayers.addCount() <= 2) {
onDecode();
} else {
onError(event);

@ -731,7 +731,7 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
}
private void checkError(ErrorEvent event) {
if (mPlayers.isHard() && event.getCode() / 1000 == 4) {
if (event.getCode() / 1000 == 4 && mPlayers.addCount() <= 2) {
onDecode();
} else {
onError(event);

@ -1136,7 +1136,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
}
private void checkError(ErrorEvent event) {
if (mPlayers.isHard() && event.getCode() / 1000 == 4) {
if (event.getCode() / 1000 == 4 && mPlayers.addCount() <= 2) {
onDecode();
} else {
onError(event);

@ -74,6 +74,7 @@ public class Players implements Player.Listener, ParseCallback {
private long position;
private int decode;
private int count;
private int error;
private int retry;
@ -145,10 +146,15 @@ public class Players implements Player.Listener, ParseCallback {
this.position = position;
}
public int addCount() {
return ++count;
}
public void reset() {
position = C.TIME_UNSET;
removeTimeoutCheck();
stopParse();
count = 0;
error = 0;
retry = 0;
}

@ -790,7 +790,7 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
}
private void checkError(ErrorEvent event) {
if (mPlayers.isHard() && event.getCode() / 1000 == 4) {
if (event.getCode() / 1000 == 4 && mPlayers.addCount() <= 2) {
onDecode();
} else {
onError(event);

@ -1159,7 +1159,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
}
private void checkError(ErrorEvent event) {
if (mPlayers.isHard() && event.getCode() / 1000 == 4) {
if (event.getCode() / 1000 == 4 && mPlayers.addCount() <= 2) {
onDecode();
} else {
onError(event);

Loading…
Cancel
Save