Fix bugs related VLC external app not found and Downloads crash the a…#2783
Fix bugs related VLC external app not found and Downloads crash the a…#2783asheeshsahu7300 wants to merge 1 commit into
Conversation
…pp into safe mode issues
fire-light43
left a comment
There was a problem hiding this comment.
Great changes! These will really improve CloudStream.
However, please explain how you used AI to make this pull request as per our AI policy.
Please also split these fixes into two pull requests. It makes them easier to review and merge separately.
| if (currentIndex >= items.size) return@withLock -1 | ||
| val writtenIndex = | ||
| (metadata.bytesWritten - stream.startAt) / items.chuckSize | ||
| if (currentIndex > writtenIndex + (parallelConnections * 2).coerceAtLeast(5)) { |
There was a problem hiding this comment.
Use metadata.bytesDownloaded and metadata.bytesWritten to ensure that you never have too much in RAM, no need to change any other logic!
This check should be placed in fileMutex.withLock to ensure that the metadata is accessed safely, but the delay should be outside the lock.
| <package android:name="is.xyz.mpv.kt.preview" /> | ||
| <package android:name="com.brouken.player" /> | ||
| <package android:name="com.nextplayer.pro" /> | ||
| <package android:name="com.instantbits.cast.webvideo" /> |
There was a problem hiding this comment.
Only use players we have included in the app. See https://github.com/recloudstream/cloudstream/tree/master/app/src/main/java/com/lagradost/cloudstream3/actions/temp
| [versions] | ||
| activityKtx = "1.13.0" | ||
| androidGradlePlugin = "9.1.1" | ||
| androidGradlePlugin = "9.0.0" |
There was a problem hiding this comment.
Please remove this, there is no reason to downgrade to 9.0.0.
| android:name="android.permission.QUERY_ALL_PACKAGES" | ||
| tools:ignore="QueryAllPackagesPermission" /> | ||
|
|
||
| <queries> |
There was a problem hiding this comment.
Add a short comment here explaining why we need queries when we already have QUERY_ALL_PACKAGES.
There was a problem hiding this comment.
It could be something as simple as "QUERY_ALL_PACKAGES does not work on X device running Android Y so we also have to specify the packages we query."
Viewed AndroidManifest.xml:275-284
Ran command:
git commit -m "fix bugs related VLC external app not found and Downloads crash the app into safe mode issues"Ran command:
git pushHere is a detailed PR description you can use for your pull request:
Description: Fix External Player Visibility and Downloader Memory Exhaustion
This PR addresses two critical issues: the "App not found" error when launching external players on Android 11+ (specifically Google TV 14) and a memory-related crash during large downloads on Android 16.
Changes:
1. Fix External Player Visibility (Android 11+ / Google TV 14)
ActivityNotFoundException("App not found").<queries>block toAndroidManifest.xmlto explicitly declare visibility for common video players (VLC, mpv, Just Player, etc.) and intent patterns (video/*,magnet).2. Prevent Downloader OutOfMemory (OOM) Crashes
DownloadManager.kt. The downloader now pauses additional segment requests if it is too far ahead of the data currently being written to disk.3. Build Configuration
9.1.1to9.0.0to ensure compatibility with the current build environment requirements.Testing:
AndroidManifest.xmlvalidity.DownloadManager.ktlogic correctly handles parallel connections with the new lookahead distance../gradlew help.Steps to Reproduce (Fixed):