Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
15
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
d5392279
Commit
d5392279
authored
5 years ago
by
Geoffrey Métais
Committed by
Nicolas Pomepuy
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Browser: Lift flow channel buffer limitation
Fix #1117
parent
9a9687a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!350
Browser: Lift flow channel buffer limitation
Pipeline
#11645
passed with stage
in 4 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+6
-9
6 additions, 9 deletions
...android/src/org/videolan/vlc/providers/BrowserProvider.kt
with
6 additions
and
9 deletions
vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+
6
−
9
View file @
d5392279
...
...
@@ -31,10 +31,7 @@ import kotlinx.coroutines.channels.Channel
import
kotlinx.coroutines.channels.SendChannel
import
kotlinx.coroutines.channels.actor
import
kotlinx.coroutines.channels.awaitClose
import
kotlinx.coroutines.flow.channelFlow
import
kotlinx.coroutines.flow.collect
import
kotlinx.coroutines.flow.mapNotNull
import
kotlinx.coroutines.flow.toList
import
kotlinx.coroutines.flow.*
import
org.videolan.libvlc.Media
import
org.videolan.libvlc.util.MediaBrowser
import
org.videolan.libvlc.util.MediaBrowser.EventListener
...
...
@@ -123,10 +120,10 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
if
(
url
==
null
)
coroutineScope
{
discoveryJob
=
launch
{
filesFlow
(
url
).
collect
{
findMedia
(
it
)
?.
let
{
item
->
addMedia
(
item
)
}
}
}
}
else
{
val
value
=
filesFlow
(
url
).
mapNotNull
{
findMedia
(
it
)
}.
toList
()
computeHeaders
(
value
)
dataset
.
value
=
value
as
MutableList
<
MediaLibraryItem
>
parseSubDirectories
(
value
)
val
files
=
filesFlow
(
url
).
mapNotNull
{
findMedia
(
it
)
}.
toList
()
computeHeaders
(
files
)
dataset
.
value
=
files
as
MutableList
<
MediaLibraryItem
>
parseSubDirectories
(
files
)
}
if
(
url
!=
null
)
loading
.
postValue
(
false
)
}
...
...
@@ -145,7 +142,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
}
requestBrowsing
(
url
,
listener
,
interact
)
awaitClose
{
if
(
url
!=
null
)
browserActor
.
post
(
ClearListener
)
}
}
}
.
buffer
(
Channel
.
UNLIMITED
)
protected
open
fun
addMedia
(
media
:
MediaLibraryItem
)
=
dataset
.
add
(
media
)
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
12898941
·
5 years ago
mentioned in commit
12898941
mentioned in commit 128989413f53fef7a3b46fd413c3c22b41e249d7
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment