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
4c7a2a4a
Commit
4c7a2a4a
authored
5 years ago
by
Geoffrey Métais
Committed by
Geoffrey Métais
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use LibVLC encoding for medialibrary
parent
2f42309b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!436
Use LibVLC encoding for medialibrary
Pipeline
#13471
passed with stage
in 17 minutes and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java
+3
-2
3 additions, 2 deletions
...brary/src/org/videolan/medialibrary/MedialibraryImpl.java
medialibrary/src/org/videolan/medialibrary/Tools.java
+2
-5
2 additions, 5 deletions
medialibrary/src/org/videolan/medialibrary/Tools.java
with
5 additions
and
7 deletions
medialibrary/src/org/videolan/medialibrary/MedialibraryImpl.java
+
3
−
2
View file @
4c7a2a4a
...
...
@@ -30,6 +30,7 @@ import androidx.annotation.Nullable;
import
androidx.annotation.WorkerThread
;
import
org.videolan.libvlc.LibVLC
;
import
org.videolan.libvlc.util.VLCUtil
;
import
org.videolan.medialibrary.interfaces.Medialibrary
;
import
org.videolan.medialibrary.interfaces.media.Album
;
import
org.videolan.medialibrary.interfaces.media.Artist
;
...
...
@@ -118,7 +119,7 @@ public class MedialibraryImpl extends Medialibrary {
public
boolean
addDevice
(
@NonNull
String
uuid
,
@NonNull
String
path
,
boolean
removable
)
{
if
(!
mIsInitiated
)
return
false
;
final
boolean
added
=
nativeAddDevice
(
Tools
.
encodeVLCString
(
uuid
),
Tools
.
encodeVLCMrl
(
path
),
removable
);
final
boolean
added
=
nativeAddDevice
(
VLCUtil
.
encodeVLCString
(
uuid
),
Tools
.
encodeVLCMrl
(
path
),
removable
);
synchronized
(
onDeviceChangeListeners
)
{
for
(
OnDeviceChangeListener
listener
:
onDeviceChangeListeners
)
listener
.
onDeviceChange
();
}
...
...
@@ -146,7 +147,7 @@ public class MedialibraryImpl extends Medialibrary {
public
boolean
removeDevice
(
String
uuid
,
String
path
)
{
if
(!
mIsInitiated
)
return
false
;
final
boolean
removed
=
!
TextUtils
.
isEmpty
(
uuid
)
&&
!
TextUtils
.
isEmpty
(
path
)
&&
nativeRemoveDevice
(
Tools
.
encodeVLCString
(
uuid
),
Tools
.
encodeVLCMrl
(
path
));
final
boolean
removed
=
!
TextUtils
.
isEmpty
(
uuid
)
&&
!
TextUtils
.
isEmpty
(
path
)
&&
nativeRemoveDevice
(
VLCUtil
.
encodeVLCString
(
uuid
),
Tools
.
encodeVLCMrl
(
path
));
synchronized
(
onDeviceChangeListeners
)
{
for
(
OnDeviceChangeListener
listener
:
onDeviceChangeListeners
)
listener
.
onDeviceChange
();
}
...
...
This diff is collapsed.
Click to expand it.
medialibrary/src/org/videolan/medialibrary/Tools.java
+
2
−
5
View file @
4c7a2a4a
...
...
@@ -7,6 +7,7 @@ import android.text.TextUtils;
import
androidx.annotation.Nullable
;
import
org.videolan.libvlc.util.VLCUtil
;
import
org.videolan.medialibrary.interfaces.media.MediaWrapper
;
import
org.videolan.medialibrary.media.MediaLibraryItem
;
...
...
@@ -133,13 +134,9 @@ public class Tools {
return
sb
.
toString
();
}
public
static
String
encodeVLCString
(
String
mrl
)
{
return
Uri
.
encode
(
Uri
.
decode
(
mrl
),
".-_~/()&!$*+,;='@:?"
);
}
public
static
String
encodeVLCMrl
(
String
mrl
)
{
if
(
mrl
.
startsWith
(
"/"
))
mrl
=
"file://"
+
mrl
;
return
encodeVLCString
(
mrl
);
return
VLCUtil
.
encodeVLCString
(
mrl
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in issue
#1149 (closed)
·
4 years ago
mentioned in issue
#1149 (closed)
mentioned in issue #1149
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