ClippingMediaSource requires isPrepared flag to correctly check clipping assertions
See original GitHub issueContent description
When creating a ClippingMediaSource with an HTTP MediaSource for an AAC format source it fails to play and gives the following error, but if the startPosition=0 and the endPosition is the total duration of the song it works, meaning when it doesn’t actually clip anything, but setting these parameters two trimming values will result in this error:
E/ExoPlayerImplInternal: Internal runtime error.
java.lang.IllegalStateException
at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:81)
at com.google.android.exoplayer2.source.ClippingMediaPeriod.selectTracks(ClippingMediaPeriod.java:115)
at com.google.android.exoplayer2.source.DeferredMediaPeriod.selectTracks(DeferredMediaPeriod.java:163)
at com.google.android.exoplayer2.MediaPeriodHolder.applyTrackSelection(MediaPeriodHolder.java:271)
at com.google.android.exoplayer2.MediaPeriodHolder.applyTrackSelection(MediaPeriodHolder.java:233)
at com.google.android.exoplayer2.MediaPeriodHolder.handlePrepared(MediaPeriodHolder.java:165)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handlePeriodPrepared(ExoPlayerImplInternal.java:1632)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:348)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:165)
at android.os.HandlerThread.run(HandlerThread.java:61)
Link to test content
c4ca4238a0b923820dcc509a6f75849b.zip
Version of ExoPlayer being used
2.10.0
Device(s) and version(s) of Android being used
Tested on Android 8.0 and 9.0 on Emulators then Huawei, Samsung and Nexus physical devices.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
FakeMediaSource - Android Developers
Assert that a media period for the given id has been created. ... to make sure the player reports the correct number of...
Read more >All Classes (ExoPlayer library)
Schedules a sequence of Action s for execution during a test. ActionSchedule.Builder ... Thrown when a ClippingMediaSource cannot clip its wrapped source.
Read more >Index (library-core API) - Javadoc.io
Creates a new clipping source that wraps the specified source. ClippingMediaSource(MediaSource, long, long, boolean) - Constructor for class ...
Read more >download_helper_2.2.11.1.apk - Hybrid Analysis
Suspicious Indicators 11 · Environment Awareness. Possibly tries to implement anti-virtualization techniques · General. Has the ability to invoke ...
Read more >mozilla-central: changeset 534055 ...
+ * + * <p>Note that {@code FLAG_HW_AV_SYNC} is not available because the player takes care of setting + * the flag when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As it turns out, we can’t catch this earlier at the moment because
ClippingMediaSource
doesn’t know whether the child source is not seekable because it’s actually not seekable or because we don’t have enough information yet. At the moment, we only check the clipping conditions if the duration of the child source is known, under the assumption that a known duration means that all information is available. However, for this particular AAC example, we never know the duration, so the check is not executed.This problem can be fixed by adding a new flag to
Timeline
which indicates whether we are still waiting for information. Changing toenhancement
to track adding this.Thank you so much!! 🚀