Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
534
Issue boards
Milestones
Wiki
Code
Merge requests
10
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
154f0c66
Commit
154f0c66
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Ensure Medialibrary is started only once
parent
5f6a9be3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#10086
passed with stage
in 23 minutes and 44 seconds
Changes
2
Pipelines
1
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 @
154f0c66
...
...
@@ -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 @
154f0c66
...
...
@@ -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.
Nicolas Pomepuy
@Aza
mentioned in commit
70e74112
·
5 years ago
mentioned in commit
70e74112
mentioned in commit 70e74112171b07c4488dc0b85344b5dc92af7599
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