[Android] Medialibrary: preserve flags with findMedia()
Geoffrey Métais
git at videolan.org
Fri Dec 7 18:11:22 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 7 17:58:36 2018 +0100| [4d82e7dee753fdf5d10a26e7e98916bfbe86756b] | committer: Geoffrey Métais
Medialibrary: preserve flags with findMedia()
> https://code.videolan.org/videolan/vlc-android/commit/4d82e7dee753fdf5d10a26e7e98916bfbe86756b
---
medialibrary/src/org/videolan/medialibrary/Medialibrary.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
index d556aa6e3..c1a4e9a8c 100644
--- a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
@@ -486,11 +486,17 @@ public class Medialibrary {
if (mIsInitiated && mw != null && mw.getId() == 0L) {
final Uri uri = mw.getUri();
final MediaWrapper libraryMedia = getMedia(uri);
- if (libraryMedia != null) return libraryMedia;
+ if (libraryMedia != null) {
+ libraryMedia.addFlags(mw.getFlags());
+ return libraryMedia;
+ }
if (TextUtils.equals("file", uri.getScheme()) &&
uri.getPath() != null && uri.getPath().startsWith("/sdcard")) {
final MediaWrapper alternateMedia = getMedia(Tools.convertLocalUri(uri));
- if (alternateMedia != null) return alternateMedia;
+ if (alternateMedia != null) {
+ alternateMedia.addFlags(mw.getFlags());
+ return alternateMedia;
+ }
}
}
return mw;
More information about the Android
mailing list