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
ffc4f593
Commit
ffc4f593
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Fix Crash loading last playlist from wired headset
parent
68f2cbb3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+4
-6
4 additions, 6 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
with
4 additions
and
6 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+
4
−
6
View file @
ffc4f593
...
...
@@ -8,10 +8,8 @@ import android.support.v7.preference.PreferenceManager
import
android.text.TextUtils
import
android.util.Log
import
android.widget.Toast
import
kotlinx.coroutines.experimental.
CoroutineStart
import
kotlinx.coroutines.experimental.
*
import
kotlinx.coroutines.experimental.android.UI
import
kotlinx.coroutines.experimental.async
import
kotlinx.coroutines.experimental.launch
import
org.videolan.libvlc.Media
import
org.videolan.libvlc.MediaPlayer
import
org.videolan.medialibrary.Medialibrary
...
...
@@ -114,7 +112,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
@Volatile
private
var
loadingLastPlaylist
=
false
fun
loadLastPlaylist
(
type
:
Int
)
:
Boolean
{
if
(
loadingLastPlaylist
)
return
fals
e
if
(
loadingLastPlaylist
)
return
tru
e
loadingLastPlaylist
=
true
val
audio
=
type
==
Constants
.
PLAYLIST_TYPE_AUDIO
val
currentMedia
=
settings
.
getString
(
if
(
audio
)
"current_song"
else
"current_media"
,
""
)
...
...
@@ -122,9 +120,9 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val
locations
=
settings
.
getString
(
if
(
audio
)
"audio_list"
else
"media_list"
,
""
).
split
(
" "
.
toRegex
()).
dropLastWhile
({
it
.
isEmpty
()
}).
toTypedArray
()
if
(
Util
.
isArrayEmpty
(
locations
))
return
false
launch
(
UI
,
CoroutineStart
.
UNDISPATCHED
)
{
val
playList
=
async
{
val
playList
=
withContext
(
CommonPool
)
{
locations
.
map
{
Uri
.
decode
(
it
)
}.
mapTo
(
ArrayList
(
locations
.
size
))
{
MediaWrapper
(
Uri
.
parse
(
it
))
}
}
.
await
()
}
// load playlist
shuffling
=
settings
.
getBoolean
(
if
(
audio
)
"audio_shuffling"
else
"media_shuffling"
,
false
)
repeating
=
settings
.
getInt
(
if
(
audio
)
"audio_repeating"
else
"media_repeating"
,
Constants
.
REPEAT_NONE
)
...
...
This diff is collapsed.
Click to expand it.
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