mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Compare commits
2 Commits
4d68243158
...
a7c897003c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a7c897003c | ||
![]() |
8483b92620 |
@ -9,6 +9,8 @@
|
|||||||
scrubber bar around). The behavior of scrubbing mode can be customized
|
scrubber bar around). The behavior of scrubbing mode can be customized
|
||||||
with `setScrubbingModeParameters(..)` on `ExoPlayer` and
|
with `setScrubbingModeParameters(..)` on `ExoPlayer` and
|
||||||
`ExoPlayer.Builder`.
|
`ExoPlayer.Builder`.
|
||||||
|
* Fix bug where prepare errors in the content of `AdsMediaSource` may be
|
||||||
|
never reported ([#2337](https://github.com/androidx/media/issues/2337)).
|
||||||
* Transformer:
|
* Transformer:
|
||||||
* Filling an initial gap (added via `addGap()`) with silent audio now
|
* Filling an initial gap (added via `addGap()`) with silent audio now
|
||||||
requires explicitly setting `experimentalSetForceAudioTrack(true)` in
|
requires explicitly setting `experimentalSetForceAudioTrack(true)` in
|
||||||
|
@ -102,13 +102,6 @@ public final class MaskingMediaSource extends WrappingMediaSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("MissingSuperCall")
|
|
||||||
public void maybeThrowSourceInfoRefreshError() {
|
|
||||||
// Do nothing. Source info refresh errors will be thrown when calling
|
|
||||||
// MaskingMediaPeriod.maybeThrowPrepareError.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MaskingMediaPeriod createPeriod(
|
public MaskingMediaPeriod createPeriod(
|
||||||
MediaPeriodId id, Allocator allocator, long startPositionUs) {
|
MediaPeriodId id, Allocator allocator, long startPositionUs) {
|
||||||
|
@ -16818,6 +16818,27 @@ public final class ExoPlayerTest {
|
|||||||
assertThat(shouldRendererThrowRecoverableError.get()).isFalse();
|
assertThat(shouldRendererThrowRecoverableError.get()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void prepareMaskingMediaSource_withRealSourcePrepareError_reportsPlaybackException()
|
||||||
|
throws Exception {
|
||||||
|
ExoPlayer player = new TestExoPlayerBuilder(context).build();
|
||||||
|
FakeMediaSource realSourceWithPrepareFailure =
|
||||||
|
new FakeMediaSource() {
|
||||||
|
@Override
|
||||||
|
public void maybeThrowSourceInfoRefreshError() throws IOException {
|
||||||
|
throw new IOException();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
realSourceWithPrepareFailure.setAllowPreparation(false);
|
||||||
|
MediaSource maskingMediaSource =
|
||||||
|
new MaskingMediaSource(realSourceWithPrepareFailure, /* useLazyPreparation= */ false);
|
||||||
|
player.setMediaSource(maskingMediaSource);
|
||||||
|
|
||||||
|
player.prepare();
|
||||||
|
// Assert the prepare error is reported.
|
||||||
|
advance(player).untilPlayerError();
|
||||||
|
}
|
||||||
|
|
||||||
// Internal methods.
|
// Internal methods.
|
||||||
|
|
||||||
private void addWatchAsSystemFeature() {
|
private void addWatchAsSystemFeature() {
|
||||||
|
@ -113,6 +113,7 @@ public final class AndroidTestUtil {
|
|||||||
protected PlaybackVideoGraphWrapper createPlaybackVideoGraphWrapper(
|
protected PlaybackVideoGraphWrapper createPlaybackVideoGraphWrapper(
|
||||||
Context context, VideoFrameReleaseControl videoFrameReleaseControl) {
|
Context context, VideoFrameReleaseControl videoFrameReleaseControl) {
|
||||||
return new PlaybackVideoGraphWrapper.Builder(context, videoFrameReleaseControl)
|
return new PlaybackVideoGraphWrapper.Builder(context, videoFrameReleaseControl)
|
||||||
|
.setEnablePlaylistMode(true)
|
||||||
.setClock(getClock())
|
.setClock(getClock())
|
||||||
.setEnableReplayableCache(true)
|
.setEnableReplayableCache(true)
|
||||||
.build();
|
.build();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user