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
14
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
c62c507b
Commit
c62c507b
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash when playing a media container with missing medias
parent
d3f643e0
No related branches found
Branches containing commit
Tags
libvlc-3.4.0-eap7
Tags containing commit
Loading
Pipeline
#169398
passed with stage
in 21 minutes and 41 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt
+8
-8
8 additions, 8 deletions
...src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt
with
8 additions
and
8 deletions
application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt
+
8
−
8
View file @
c62c507b
...
...
@@ -87,8 +87,8 @@ class VideosViewModel(context: Context, type: VideoGroupingType, val folder: Fol
val
item
=
provider
.
pagedList
.
value
?.
get
(
position
)
?:
return
@launch
withContext
(
Dispatchers
.
IO
)
{
when
(
item
)
{
is
Folder
->
item
.
getAll
()
is
VideoGroup
->
item
.
getAll
()
is
Folder
->
item
.
getAll
(
includeMissing
=
false
)
is
VideoGroup
->
item
.
getAll
(
includeMissing
=
false
)
is
MediaWrapper
->
listOf
(
item
)
else
->
null
}
...
...
@@ -99,15 +99,15 @@ class VideosViewModel(context: Context, type: VideoGroupingType, val folder: Fol
val
item
=
provider
.
pagedList
.
value
?.
get
(
position
)
?:
return
@launch
withContext
(
Dispatchers
.
IO
)
{
when
(
item
)
{
is
Folder
->
item
.
getAll
()
is
VideoGroup
->
item
.
getAll
()
is
Folder
->
item
.
getAll
(
includeMissing
=
false
)
is
VideoGroup
->
item
.
getAll
(
includeMissing
=
false
)
else
->
null
}
}
?.
let
{
MediaUtils
.
appendMedia
(
context
,
it
)
}
}
internal
fun
playFoldersSelection
(
selection
:
List
<
Folder
>)
=
viewModelScope
.
launch
{
val
list
=
selection
.
flatMap
{
it
.
getAll
()
}
val
list
=
selection
.
flatMap
{
it
.
getAll
(
includeMissing
=
false
)
}
MediaUtils
.
openList
(
context
,
list
,
0
)
}
...
...
@@ -115,15 +115,15 @@ class VideosViewModel(context: Context, type: VideoGroupingType, val folder: Fol
val
item
=
provider
.
pagedList
.
value
?.
get
(
position
)
?:
return
@launch
withContext
(
Dispatchers
.
IO
)
{
when
(
item
)
{
is
Folder
->
item
.
getAll
()
is
VideoGroup
->
item
.
getAll
()
is
Folder
->
item
.
getAll
(
includeMissing
=
false
)
is
VideoGroup
->
item
.
getAll
(
includeMissing
=
false
)
else
->
null
}
}
?.
let
{
if
(
activity
.
isStarted
())
activity
.
addToPlaylist
(
it
)
}
}
internal
fun
appendFoldersSelection
(
selection
:
List
<
Folder
>)
=
viewModelScope
.
launch
{
val
list
=
selection
.
flatMap
{
it
.
getAll
()
}
val
list
=
selection
.
flatMap
{
it
.
getAll
(
includeMissing
=
false
)
}
MediaUtils
.
appendMedia
(
context
,
list
)
}
...
...
This diff is collapsed.
Click to expand it.
Nicolas Pomepuy
@Aza
mentioned in commit
b84d4020
·
3 years ago
mentioned in commit
b84d4020
mentioned in commit b84d4020c19d513b2a7e3025e7c9699e2cf6f574
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