straw/app/src/main/java/org/schabi/newpipe
evermind 946b463895 Prevent error msg: 'Unrecoverable player error occurred' while playing video during rotation (#6502)
Playing a video in VideoDetailFragment and rotating the screen to landscape (back and forth more often)
can trigger this error message. Especially if rotation for whatever reason takes long or
playing a high resolution (1080p) video.

The underlying logcat error messages:
05-12 16:38:38.251 24920 26037 E Surface : getSlotFromBufferLocked: unknown buffer: 0x923fc810
05-12 16:38:38.251 24920 26037 W ACodec  : [OMX.qcom.video.decoder.avc] can not return buffer 35 to native window

The problem is that that Exoplayer is trying to write to our -- during rotation -- no longer existant
(VideoDetailFragment) SurfaceView.

Solution:
Implementing SurfaceHolder.Callback and using DummySurface we can now handle the lifecycle of the Surface.

How?: In case we are no longer able to write to the Surface eg. through rotation/putting in
background we can set a DummySurface. Although it only works on API >= 23.
Result: we get a little video interruption (audio is still fine) but we won't get the
'Unrecoverable player error occurred' error message.

This implementation is based on and more background information:
 'ExoPlayer stuck in buffering after re-adding the surface view a few time 2703'

 -> exoplayer fix suggestion link
  https://github.com/google/ExoPlayer/issues/2703#issuecomment-300599981
2021-07-06 12:49:56 +02:00
..
about Fix the compile error 2021-06-11 12:19:29 +02:00
database Merge pull request #6313 from Isira-Seneviratne/Update_Room_to_2.3.0 2021-06-09 16:28:55 +02:00
download Reimplement storing backup import/export path 2021-06-08 10:41:24 +02:00
error Fix an error and add a new method in the ShareUtils class 2021-06-11 12:12:09 +02:00
fragments Fix disposables handling for text linkifier 2021-06-11 12:12:12 +02:00
info_list Move some classes to a new subpackage and adress requested changes 2021-06-11 12:12:02 +02:00
ktx Make some minor changes 2021-05-15 18:48:16 +03:00
local Move some classes to a new subpackage and adress requested changes 2021-06-11 12:12:02 +02:00
player Prevent error msg: 'Unrecoverable player error occurred' while playing video during rotation (#6502) 2021-07-06 12:49:56 +02:00
settings Merge pull request #6346 from Imericxu/tabs-style-check 2021-06-08 14:49:14 +02:00
streams Reimplement storing backup import/export path 2021-06-08 10:41:24 +02:00
util Merge pull request #6059 from Dakkaron/manual-tablet-mode-setting 2021-06-15 21:46:19 +02:00
views Apply the requested changes and little improvements 2021-01-16 13:23:42 +01:00
App.java Support SAF properly 2021-06-08 10:40:44 +02:00
BaseFragment.java Move description to a tab alongside related streams and comments 2021-01-17 15:26:25 +01:00
CheckForNewAppVersion.java Don't use a chooser for other intents than opening a content in a browser or sharing a content to other apps 2021-06-11 12:12:05 +02:00
DownloaderImpl.java Merge pull request #5649 from FireMasterK/ff-ua 2021-03-24 17:59:17 +01:00
ExitActivity.java Clean up SDK version checks 2020-09-06 12:55:30 +02:00
ImageDownloader.java Apply the requested changes and little improvements 2021-01-16 13:23:42 +01:00
MainActivity.java Suppress a warning 2021-06-05 16:13:12 +02:00
NewPipeDatabase.java Use final where possible 2020-08-16 10:25:09 +02:00
NewVersionManager.kt Respect expires header when checking for new version 2021-01-23 09:02:11 +01:00
PanicResponderActivity.java Clean up SDK version checks 2020-09-06 12:55:30 +02:00
RouterActivity.java Fix an error and add a new method in the ShareUtils class 2021-06-11 12:12:09 +02:00