Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after pre-roll intro #397

Closed
Electry opened this issue May 22, 2021 · 2 comments · Fixed by #399
Closed

Crash after pre-roll intro #397

Electry opened this issue May 22, 2021 · 2 comments · Fixed by #399
Labels
bug Something isn't working exoplayer Related to the ExoPlayer integration upstream An issue that is not related to the app, but an upstream component (dependency, backend, web UI)

Comments

@Electry
Copy link

Electry commented May 22, 2021

Describe the bug
The Jellyfin app crashes after a pre-roll intro is finished. This seems to be a regression in v2.3.0-beta.2 (everything was fine in v2.3.0-beta.1).

To Reproduce

  1. Install and configure the jellyfin-plugin-intros (https://github.com/dkanada/jellyfin-plugin-intros) on your server (I'm using local .mp4 preroll)
  2. Make sure Cinema mode is enabled in Jellyfin settings -> Playback
  3. Click on any video (movie/episode) to start the playback
  4. The pre-roll plays just fine
  5. After the pre-roll is finished, the Jellyfin app crashes (back to the android launcher). This happens even if you click the "Next" button in exoplayer while the pre-roll is playing (to continue to the actual movie/episode).

Expected behavior
After the pre-roll intro ends, the selected movie/episode should play.

Logs

05-22 13:53:16.437 28607 28607 E AndroidRuntime: FATAL EXCEPTION: main
05-22 13:53:16.437 28607 28607 E AndroidRuntime: Process: org.jellyfin.mobile, PID: 28607
05-22 13:53:16.437 28607 28607 E AndroidRuntime: java.lang.ClassCastException: l.r.j.a cannot be cast to org.jellyfin.mobile.player.source.JellyfinMediaSource
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at org.jellyfin.mobile.player.source.MediaQueueManager.next(MediaQueueManager.kt:15)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at org.jellyfin.mobile.player.PlayerViewModel$skipToNext$1.invokeSuspend(PlayerViewModel.kt:4)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at l.r.k.a.a.resumeWith(ContinuationImpl.kt:3)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at m.a.h2.f.a(DispatchedContinuation.kt:24)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at k.a.a.f.G2(Unknown Source:1)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at m.a.c.y0(AbstractCoroutine.kt:15)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at k.a.a.f.I1(Unknown Source:5)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at k.a.a.f.J1(Unknown Source:3)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at org.jellyfin.mobile.player.PlayerViewModel.skipToNext(PlayerViewModel.kt:1)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at org.jellyfin.mobile.player.PlayerFragment.onSkipToNext(PlayerFragment.kt:1)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at org.jellyfin.mobile.player.PlaybackMenus._init_$lambda-1(PlaybackMenus.kt:1)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at b.a.b.z.g.onClick(lambda:1)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.view.View.performClick(View.java:7259)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.view.View.performClickInternal(View.java:7221)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.view.View.access$3800(View.java:821)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.view.View$PerformClick.run(View.java:27716)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:883)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:100)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:227)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7842)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
05-22 13:53:16.437 28607 28607 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
05-22 13:53:16.447  1790  3357 W ActivityTaskManager:   Force finishing activity org.jellyfin.mobile/.MainActivity

Screenshots
none

System (please complete the following information):

  • App version: v2.3.0-beta.2
  • Android version: Android 10
  • Device manufacturer and model: Realme X2 Pro
  • Jellyfin server version: 10.7.5
  • The type of video player implementation used: ExoPlayer

Additional context
If you disable Cinema mode, the movie/episode plays just fine (with no intro of course).

@Electry Electry added the bug Something isn't working label May 22, 2021
@Maxr1998
Copy link
Member

Maxr1998 commented May 22, 2021

Could you try with the debug version so that we get a better stack trace? It seems one of the smart casts fails, which shouldn't even be possible.. 🤔

Stacktrace from debug version:

Jellyfin Debug crashed in main thread
Version code: 1
Version name: 0.0.0-dev.1
Stack Trace:
java.lang.ClassCastException: kotlin.coroutines.intrinsics.CoroutineSingletons cannot be cast to org.jellyfin.mobile.player.source.JellyfinMediaSource
	at org.jellyfin.mobile.player.source.MediaQueueManager.next(MediaQueueManager.kt:103)
	at org.jellyfin.mobile.player.PlayerViewModel$onPlayerStateChanged$2.invokeSuspend(PlayerViewModel.kt:358)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:377)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
	at org.jellyfin.mobile.player.PlayerViewModel.onPlayerStateChanged(PlayerViewModel.kt:350)
	at com.google.android.exoplayer2.ExoPlayerImpl.lambda$updatePlaybackInfo$13(ExoPlayerImpl.java:1052)
	at com.google.android.exoplayer2.-$$Lambda$ExoPlayerImpl$eAKzukwdd6P91AoYEF8JC1HDnJ4.invoke(Unknown Source:4)
	at com.google.android.exoplayer2.util.ListenerSet$ListenerHolder.invoke(ListenerSet.java:297)
	at com.google.android.exoplayer2.util.ListenerSet.lambda$queueEvent$0(ListenerSet.java:184)
	at com.google.android.exoplayer2.util.-$$Lambda$ListenerSet$NbKDn9xtItiyMgYZmjIx_Sv1FFQ.run(Unknown Source:6)
	at com.google.android.exoplayer2.util.ListenerSet.flushEvents(ListenerSet.java:205)
	at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:1101)
	at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:965)
	at com.google.android.exoplayer2.ExoPlayerImpl.lambda$new$1$ExoPlayerImpl(ExoPlayerImpl.java:181)
	at com.google.android.exoplayer2.-$$Lambda$ExoPlayerImpl$nOBJYkeEQ2uz3sBKLToLWmzrgZk.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7660)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Seems to be in relation to Kotlin/kotlinx.coroutines#1091, however, this should have been fixed already. Needs more investigation. Possibly a regression in kotlinx.coroutines.

@Maxr1998 Maxr1998 added the exoplayer Related to the ExoPlayer integration label May 22, 2021
@Maxr1998
Copy link
Member

Quite likely to be a bug in the Coroutines library in combination with inline classes like Result. A very similar issue is tracked as KT-46873, however, I'm not sure whether method visibility is the underlying cause here. Marking as upstream. A workaround would be migrating away from inline classes for the result for now.

@Maxr1998 Maxr1998 added the upstream An issue that is not related to the app, but an upstream component (dependency, backend, web UI) label May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exoplayer Related to the ExoPlayer integration upstream An issue that is not related to the app, but an upstream component (dependency, backend, web UI)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants