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

Update to ExoPlayer 2.10.5 #2697

Merged
merged 6 commits into from
Oct 10, 2019
Merged

Update to ExoPlayer 2.10.5 #2697

merged 6 commits into from
Oct 10, 2019

Conversation

Redirion
Copy link
Member

@Redirion Redirion commented Oct 7, 2019

As we now finally have AndroidX I was able to update ExoPlayer to the latest version.
This brings numerous of needed fixes and improvements to NewPipe. Have a look at the ReleaseNotes: https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md

This might close #2257 and #2373 and possible other issues.

Debug apk for testing: https://github.com/Redirion/NewPipe/releases/download/v0.17.3-exo/app-debug.apk

Notes for Review:

  • Changes to the MediaSessionManager and PlayQueueNavigator were mainly required due to this commit in ExoPlayer: google/ExoPlayer@063f570
  • I also had to fiddle again in CustomTrackSelector as there have been changes again. I already tried subtitles (it seems to be working fine this time :D)
  • I have updated Gradle to 3.4.0 to match ExoPlayer's gradle version
  • okhttp has been updated as well to match ExoPlayer (thus deemed stable)
  • With the new isPlaying() method in BasePlayer NewPipe makes already use of a new feature added in ExoPlayer 2.10.5

@TobiGr
Copy link
Contributor

TobiGr commented Oct 7, 2019

I think something went wrong while rebasing / merging. Should I force push the branch to get it right?

@Redirion
Copy link
Member Author

Redirion commented Oct 7, 2019

why does this always happen..
I saw your extractor update commit, got excited and wanted to to everything right with a rebase. So I did:
git remote add upstream https://github.com/TeamNewPipe/NewPipe.git
git fetch upstream
git rebase dev <- maybe I should have skipped this one?
git pull --rebase upstream dev
git pull
git push -u origin exoplayer2105

I should have just click the update button here (but I was once told, that this is not the preferred way)

Can you fix it? 😞

@TobiGr
Copy link
Contributor

TobiGr commented Oct 7, 2019

I tried to open a video
Happens when rotating the screen

Exception

  • User Action: ui error
  • Request: App crash, UI failure
  • Content Language: GB
  • Service: none
  • Version: 0.17.3
  • OS: Linux ,release-keys 6.0 - 23
Crash log

java.lang.RuntimeException: Unable to destroy activity {org.schabi.newpipe.debug/org.schabi.newpipe.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.viewpager.widget.ViewPager.setAdapter(androidx.viewpager.widget.PagerAdapter)' on a null object reference
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3852)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3870)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4074)
	at android.app.ActivityThread.-wrap15(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1360)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5443)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.viewpager.widget.ViewPager.setAdapter(androidx.viewpager.widget.PagerAdapter)' on a null object reference
	at org.schabi.newpipe.fragments.MainFragment.onDestroy(MainFragment.java:115)
	at androidx.fragment.app.Fragment.performDestroy(Fragment.java:2830)
	at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1028)
	at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
	at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1310)
	at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
	at androidx.fragment.app.FragmentManagerImpl.dispatchDestroy(FragmentManagerImpl.java:2644)
	at androidx.fragment.app.FragmentController.dispatchDestroy(FragmentController.java:329)
	at androidx.fragment.app.FragmentActivity.onDestroy(FragmentActivity.java:366)
	at androidx.appcompat.app.AppCompatActivity.onDestroy(AppCompatActivity.java:233)
	at org.schabi.newpipe.MainActivity.onDestroy(MainActivity.java:352)
	at android.app.Activity.performDestroy(Activity.java:6415)
	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1165)
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3839)
	... 10 more
java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.viewpager.widget.ViewPager.setAdapter(androidx.viewpager.widget.PagerAdapter)' on a null object reference
	at org.schabi.newpipe.fragments.MainFragment.onDestroy(MainFragment.java:115)
	at androidx.fragment.app.Fragment.performDestroy(Fragment.java:2830)
	at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1028)
	at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
	at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1310)
	at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
	at androidx.fragment.app.FragmentManagerImpl.dispatchDestroy(FragmentManagerImpl.java:2644)
	at androidx.fragment.app.FragmentController.dispatchDestroy(FragmentController.java:329)
	at androidx.fragment.app.FragmentActivity.onDestroy(FragmentActivity.java:366)
	at androidx.appcompat.app.AppCompatActivity.onDestroy(AppCompatActivity.java:233)
	at org.schabi.newpipe.MainActivity.onDestroy(MainActivity.java:352)
	at android.app.Activity.performDestroy(Activity.java:6415)
	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1165)
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3839)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3870)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4074)
	at android.app.ActivityThread.-wrap15(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1360)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5443)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)


@TobiGr
Copy link
Contributor

TobiGr commented Oct 7, 2019

I think the last git pull is wrong. However, where does the merge commit come from?

@Redirion
Copy link
Member Author

Redirion commented Oct 7, 2019

from git pull --rebase upstream dev, it automatically created the merge.
I don't see how your crash is related to the ExoPlayer Update (also unable to reproduce)

before I made the last "git pull", "git status" gave this output:
Auf Branch exoplayer2105
Ihr Branch und 'origin/exoplayer2105' sind divergiert,
und haben jeweils 5 und 4 unterschiedliche Commits.
(benutzen Sie "git pull", um Ihren Branch mit dem Remote-Branch zusammenzuführen)

nichts zu committen, Arbeitsverzeichnis unverändert.

edit: Maybe it was that last git pull that created the merge.

@TobiGr
Copy link
Contributor

TobiGr commented Oct 7, 2019

from git pull --rebase upstream dev, it automatically created the merge.

Not for me 🤔

I don't see how your crash is related to the ExoPlayer Updat (also unable to reproduce)

Oh yeah, I cannot reproduce it either... It just happened the first time I tried to open a video.

Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just white spaces

Co-Authored-By: Tobias Groza <TobiGr@users.noreply.github.com>
@TobiGr
Copy link
Contributor

TobiGr commented Oct 7, 2019

I'll do some further testing on most supported Android versions during the day to make sure nothing broke. NewPipe without a working player is quite useless. When testing succeeds, I'll merge and start preparations for a new release.

@Redirion
Copy link
Member Author

Redirion commented Oct 7, 2019

Samsung Galaxy S7 with Android 8.0.0 looking good so far

@Stypox
Copy link
Member

Stypox commented Oct 7, 2019

Changing resolution and then changing it again before the video has finished loading causes the playback time to reset to 0:00. This bug is not present in the latest app release.

Apart from this everything looks good on Android 7

@Pentaphon
Copy link

Increase maximum video buffer size from 13MB to 32MB. The previous default was too small for high quality streams.

Yes! We needed this for Newpipe videos for sure.

@Redirion
Copy link
Member Author

Redirion commented Oct 7, 2019

Changing resolution and then changing it again before the video has finished loading causes the playback time to reset to 0:00. This bug is not present in the latest app release.

what kind of usage scenario is this? 😀 do you consider this blocking? I am not even fast enough at switching between resolutions to reproduce that..

@TobiGr TobiGr mentioned this pull request Oct 7, 2019
1 task
@Stypox
Copy link
Member

Stypox commented Oct 7, 2019

I was trying to play a video with low internet, so I had to switch resolution, but I pressed on the wrong one so I got this problem. I agree this is not blocking, but if it's just a small problem fixable in no time it could as well be fixed. Though if it would be too much of a hassle to fix it then nevermind.

@Redirion
Copy link
Member Author

Redirion commented Oct 8, 2019

I have compared MainFragment with the other Fragment classes and added a null check that is inline with the other onDestroy methods as a simple fix. I have replaced the debug apk for retesting.
(This might sound as the lazy fix, but was also the most reasonable I think 😄)

@Redirion
Copy link
Member Author

Redirion commented Oct 10, 2019

@TobiGr the winter semester has begun, so I understand that your spare time gets limited. Could you try to prepare a RC so that testing AndroidX and ExoPlayer 2.10 gets more traction? Thank you!

@TobiGr
Copy link
Contributor

TobiGr commented Oct 10, 2019

Sorry, for the late response, I though you were trying to fix the issue mentioned by @Stypox. But I agree that this is not blocking. Nevertheless it should be fixed.

@TobiGr TobiGr merged commit 28ed987 into TeamNewPipe:dev Oct 10, 2019
@Redirion
Copy link
Member Author

Redirion commented Oct 10, 2019

Sorry, for the late response, I though you were trying to fix the issue mentioned by @Stypox. But I agree that this is not blocking. Nevertheless it should be fixed.

But I did a commit with a null check to fix the crash. I explained it in a comment here and in the AndroidX PR to you. (you just merged that commit as well, as It was pushed here)

@TobiGr
Copy link
Contributor

TobiGr commented Oct 10, 2019

But I did a commit with a null check to fix the crash. I explained it in a comment here and in the AndroidX PR to you.

Yes, I saw that. Thank you :) But I meant this one;

Changing resolution and then changing it again before the video has finished loading causes the playback time to reset to 0:00. This bug is not present in the latest app release.

@Redirion
Copy link
Member Author

Redirion commented Oct 10, 2019

@TobiGr
I thought that was the same issue, as I was able to reproduce the bug by wildly rotating the screen. The error message did not always appear (it was hidden by the rebuild fragment) but playback was reset.

@Stypox are you still able to reproduce the playback reset bug with the latest debug apk?

btw. he did a "thumps up" on my comment about the null fix so I thought the issue was resolved for him.

@TobiGr
Copy link
Contributor

TobiGr commented Oct 10, 2019

Oh yes. I cannot repro it with latest comment either. Before I was able to do so. Perfect 👍

@Stypox
Copy link
Member

Stypox commented Oct 10, 2019

No, it seems to be fixed, thanks :-)

@TobiGr TobiGr mentioned this pull request Oct 10, 2019
@Redirion Redirion deleted the exoplayer2105 branch October 10, 2019 12:23
@TobiGr TobiGr mentioned this pull request Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExoPlayer memory leak
4 participants