question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClippingMediaSource requires isPrepared flag to correctly check clipping assertions

See original GitHub issue

Content 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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
toniheicommented, May 22, 2019

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 to enhancement to track adding this.

0reactions
soygabimorenocommented, Mar 13, 2020

Thank you so much!! 🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found