npe bugfixes

This commit is contained in:
Yuriy Liskov
2022-03-19 09:57:59 +02:00
parent 9bcb551ed5
commit 9b06d29b18
3 changed files with 9 additions and 2 deletions
@@ -144,7 +144,7 @@ public class AutoFrameRateManager extends PlayerEventListenerHelper implements A
}
private void applyAfr() {
if (mPlayerData.isAfrEnabled()) {
if (getController() != null && mPlayerData.isAfrEnabled()) {
FormatItem videoFormat = getController().getVideoFormat();
applyAfr(videoFormat, false);
// Send data to AFR daemon via tvQuickActions app
@@ -162,6 +162,11 @@ public class AutoFrameRateHelper {
}
private void restoreOriginalState(Activity activity, boolean force) {
if (activity == null) {
Log.e(TAG, "activity == null");
return;
}
if (!isSupported()) {
Log.d(TAG, "restoreOriginalState: autoframerate not enabled... exiting...");
return;
@@ -1056,7 +1056,9 @@ public class PlaybackTransportRowPresenter extends PlaybackRowPresenter {
}
mPlaybackControlsPresenter.onUnbindViewHolder(vh.mControlsVh);
mSecondaryControlsPresenter.onUnbindViewHolder(vh.mSecondaryControlsVh);
row.setOnPlaybackProgressChangedListener(null);
if (row != null) {
row.setOnPlaybackProgressChangedListener(null);
}
super.onUnbindRowViewHolder(holder);
}