mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-11-12 05:19:13 +01:00
Merge pull request #6294 from Redirion/exodowngrade
Downgrade ExoPlayer to 2.12
This commit is contained in:
commit
5eb5dbddde
@ -105,7 +105,7 @@ ext {
|
|||||||
androidxRoomVersion = '2.3.0-alpha03'
|
androidxRoomVersion = '2.3.0-alpha03'
|
||||||
|
|
||||||
icepickVersion = '3.2.0'
|
icepickVersion = '3.2.0'
|
||||||
exoPlayerVersion = '2.13.3'
|
exoPlayerVersion = '2.12.3'
|
||||||
googleAutoServiceVersion = '1.0-rc7'
|
googleAutoServiceVersion = '1.0-rc7'
|
||||||
groupieVersion = '2.8.1'
|
groupieVersion = '2.8.1'
|
||||||
markwonVersion = '4.6.0'
|
markwonVersion = '4.6.0'
|
||||||
|
@ -500,8 +500,8 @@ public final class Player implements
|
|||||||
Log.d(TAG, "[" + Util.DEVICE_DEBUG_INFO + "] "
|
Log.d(TAG, "[" + Util.DEVICE_DEBUG_INFO + "] "
|
||||||
+ "media tunneling disabled in debug preferences");
|
+ "media tunneling disabled in debug preferences");
|
||||||
} else if (DeviceUtils.shouldSupportMediaTunneling()) {
|
} else if (DeviceUtils.shouldSupportMediaTunneling()) {
|
||||||
trackSelector.setParameters(
|
trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||||
trackSelector.buildUponParameters().setTunnelingEnabled(true));
|
.setTunnelingAudioSessionId(C.generateAudioSessionIdV21(context)));
|
||||||
} else if (DEBUG) {
|
} else if (DEBUG) {
|
||||||
Log.d(TAG, "[" + Util.DEVICE_DEBUG_INFO + "] does not support media tunneling");
|
Log.d(TAG, "[" + Util.DEVICE_DEBUG_INFO + "] does not support media tunneling");
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ public class AudioReactor implements AudioManager.OnAudioFocusChangeListener, An
|
|||||||
//////////////////////////////////////////////////////////////////////////*/
|
//////////////////////////////////////////////////////////////////////////*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAudioSessionIdChanged(final EventTime eventTime, final int audioSessionId) {
|
public void onAudioSessionId(final EventTime eventTime, final int audioSessionId) {
|
||||||
if (!PlayerHelper.isUsingDSP()) {
|
if (!PlayerHelper.isUsingDSP()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import com.google.android.exoplayer2.DefaultLoadControl;
|
|||||||
import com.google.android.exoplayer2.LoadControl;
|
import com.google.android.exoplayer2.LoadControl;
|
||||||
import com.google.android.exoplayer2.Renderer;
|
import com.google.android.exoplayer2.Renderer;
|
||||||
import com.google.android.exoplayer2.source.TrackGroupArray;
|
import com.google.android.exoplayer2.source.TrackGroupArray;
|
||||||
import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
|
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
||||||
import com.google.android.exoplayer2.upstream.Allocator;
|
import com.google.android.exoplayer2.upstream.Allocator;
|
||||||
|
|
||||||
public class LoadController implements LoadControl {
|
public class LoadController implements LoadControl {
|
||||||
@ -48,7 +48,7 @@ public class LoadController implements LoadControl {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTracksSelected(final Renderer[] renderers, final TrackGroupArray trackGroups,
|
public void onTracksSelected(final Renderer[] renderers, final TrackGroupArray trackGroups,
|
||||||
final ExoTrackSelection[] trackSelections) {
|
final TrackSelectionArray trackSelections) {
|
||||||
internalLoadControl.onTracksSelected(renderers, trackGroups, trackSelections);
|
internalLoadControl.onTracksSelected(renderers, trackGroups, trackSelections);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,12 +92,11 @@ public class LoadController implements LoadControl {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldStartPlayback(final long bufferedDurationUs, final float playbackSpeed,
|
public boolean shouldStartPlayback(final long bufferedDurationUs, final float playbackSpeed,
|
||||||
final boolean rebuffering, final long targetLiveOffsetUs) {
|
final boolean rebuffering) {
|
||||||
final boolean isInitialPlaybackBufferFilled
|
final boolean isInitialPlaybackBufferFilled
|
||||||
= bufferedDurationUs >= this.initialPlaybackBufferUs * playbackSpeed;
|
= bufferedDurationUs >= this.initialPlaybackBufferUs * playbackSpeed;
|
||||||
final boolean isInternalStartingPlayback = internalLoadControl
|
final boolean isInternalStartingPlayback = internalLoadControl
|
||||||
.shouldStartPlayback(bufferedDurationUs, playbackSpeed, rebuffering,
|
.shouldStartPlayback(bufferedDurationUs, playbackSpeed, rebuffering);
|
||||||
targetLiveOffsetUs);
|
|
||||||
return isInitialPlaybackBufferFilled || isInternalStartingPlayback;
|
return isInitialPlaybackBufferFilled || isInternalStartingPlayback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import com.google.android.exoplayer2.Player.RepeatMode;
|
|||||||
import com.google.android.exoplayer2.SeekParameters;
|
import com.google.android.exoplayer2.SeekParameters;
|
||||||
import com.google.android.exoplayer2.text.CaptionStyleCompat;
|
import com.google.android.exoplayer2.text.CaptionStyleCompat;
|
||||||
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
|
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
|
||||||
import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
|
import com.google.android.exoplayer2.trackselection.TrackSelection;
|
||||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
||||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout.ResizeMode;
|
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout.ResizeMode;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
@ -323,7 +323,7 @@ public final class PlayerHelper {
|
|||||||
return 60000;
|
return 60000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExoTrackSelection.Factory getQualitySelector() {
|
public static TrackSelection.Factory getQualitySelector() {
|
||||||
return new AdaptiveTrackSelection.Factory(
|
return new AdaptiveTrackSelection.Factory(
|
||||||
1000,
|
1000,
|
||||||
AdaptiveTrackSelection.DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS,
|
AdaptiveTrackSelection.DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS,
|
||||||
|
@ -13,7 +13,7 @@ import com.google.android.exoplayer2.RendererCapabilities.Capabilities;
|
|||||||
import com.google.android.exoplayer2.source.TrackGroup;
|
import com.google.android.exoplayer2.source.TrackGroup;
|
||||||
import com.google.android.exoplayer2.source.TrackGroupArray;
|
import com.google.android.exoplayer2.source.TrackGroupArray;
|
||||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
|
import com.google.android.exoplayer2.trackselection.TrackSelection;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,7 +28,7 @@ public class CustomTrackSelector extends DefaultTrackSelector {
|
|||||||
private String preferredTextLanguage;
|
private String preferredTextLanguage;
|
||||||
|
|
||||||
public CustomTrackSelector(final Context context,
|
public CustomTrackSelector(final Context context,
|
||||||
final ExoTrackSelection.Factory adaptiveTrackSelectionFactory) {
|
final TrackSelection.Factory adaptiveTrackSelectionFactory) {
|
||||||
super(context, adaptiveTrackSelectionFactory);
|
super(context, adaptiveTrackSelectionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ public class CustomTrackSelector extends DefaultTrackSelector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
protected Pair<ExoTrackSelection.Definition, TextTrackScore> selectTextTrack(
|
protected Pair<TrackSelection.Definition, TextTrackScore> selectTextTrack(
|
||||||
final TrackGroupArray groups,
|
final TrackGroupArray groups,
|
||||||
@NonNull final int[][] formatSupport,
|
@NonNull final int[][] formatSupport,
|
||||||
@NonNull final Parameters params,
|
@NonNull final Parameters params,
|
||||||
@ -86,7 +86,7 @@ public class CustomTrackSelector extends DefaultTrackSelector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return selectedGroup == null ? null
|
return selectedGroup == null ? null
|
||||||
: Pair.create(new ExoTrackSelection.Definition(selectedGroup, selectedTrackIndex),
|
: Pair.create(new TrackSelection.Definition(selectedGroup, selectedTrackIndex),
|
||||||
Assertions.checkNotNull(selectedTrackScore));
|
Assertions.checkNotNull(selectedTrackScore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user