Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
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
70e74112
Commit
70e74112
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Ensure Medialibrary is started only once
(cherry picked from commit
154f0c66
)
parent
4a7c26f7
No related branches found
Branches containing commit
Tags
3.2.0-beta06
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+2
-0
2 additions, 0 deletions
medialibrary/src/org/videolan/medialibrary/Medialibrary.java
vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+5
-3
5 additions, 3 deletions
vlc-android/src/org/videolan/vlc/MediaParsingService.kt
with
7 additions
and
3 deletions
medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+
2
−
0
View file @
70e74112
...
...
@@ -49,6 +49,7 @@ public class Medialibrary extends AbstractMedialibrary {
public
int
init
(
Context
context
)
{
if
(
context
==
null
)
return
ML_INIT_FAILED
;
if
(
mIsInitiated
)
return
ML_INIT_ALREADY_INITIALIZED
;
sContext
=
context
;
final
File
extFilesDir
=
context
.
getExternalFilesDir
(
null
);
File
dbDirectory
=
context
.
getDir
(
"db"
,
Context
.
MODE_PRIVATE
);
...
...
@@ -92,6 +93,7 @@ public class Medialibrary extends AbstractMedialibrary {
}
public
void
start
()
{
if
(
isStarted
())
return
;
nativeStart
();
isMedialibraryStarted
=
true
;
synchronized
(
onMedialibraryReadyListeners
)
{
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+
5
−
3
View file @
70e74112
...
...
@@ -420,9 +420,11 @@ class MediaParsingService : Service(), DevicesDiscoveryCb, CoroutineScope, Lifec
var
shouldInit
=
!
dbExists
()
val
initCode
=
medialibrary
.
init
(
context
)
medialibrary
.
exceptionHandler
=
exceptionHandler
shouldInit
=
shouldInit
or
(
initCode
==
AbstractMedialibrary
.
ML_INIT_DB_RESET
)
or
(
initCode
==
AbstractMedialibrary
.
ML_INIT_DB_CORRUPTED
)
if
(
initCode
!=
AbstractMedialibrary
.
ML_INIT_FAILED
)
initMedialib
(
action
.
parse
,
context
,
shouldInit
,
action
.
upgrade
)
else
exitCommand
()
if
(
initCode
!=
AbstractMedialibrary
.
ML_INIT_ALREADY_INITIALIZED
)
{
shouldInit
=
shouldInit
or
(
initCode
==
AbstractMedialibrary
.
ML_INIT_DB_RESET
)
or
(
initCode
==
AbstractMedialibrary
.
ML_INIT_DB_CORRUPTED
)
if
(
initCode
!=
AbstractMedialibrary
.
ML_INIT_FAILED
)
initMedialib
(
action
.
parse
,
context
,
shouldInit
,
action
.
upgrade
)
else
exitCommand
()
}
else
exitCommand
()
}
is
StartScan
->
{
scanActivated
=
true
...
...
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