Skip to content

Commit 076524b

Browse files
committed
Merge branch '3.0.13'
2 parents 68f2643 + 21300c5 commit 076524b

35 files changed

+52
-29
lines changed

.idea/misc.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and add the following in the dependent module:
1717

1818
```gradle
1919
dependencies {
20-
implementation 'com.github.masterwok:libvlc-android-sdk:3.0.11'
20+
implementation 'com.github.masterwok:libvlc-android-sdk:3.0.13'
2121
}
2222
```
2323
unless you're a fan of large APKs, you'll probably want to add the following to the build.gradle of your app so an APK is generated per ABI:

buildlibvlc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
tag='3.0.11'
3+
tag='3.0.13'
44

55
rootdir=`dirname $0`
66

libvlc/src/main/java/org/videolan/libvlc/MediaPlayer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ protected synchronized Event onEventNative(int eventType, long arg1, long arg2,
11931193

11941194
@Override
11951195
protected void onReleaseNative() {
1196+
mWindow.detachViews();
11961197
registerAudioPlug(false);
11971198

11981199
if (mMedia != null)

libvlc/src/main/java/org/videolan/libvlc/RendererDiscoverer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public void stop() {
7878
if (isReleased()) throw new IllegalStateException("MediaDiscoverer is released");
7979
setEventListener(null);
8080
nativeStop();
81+
release();
8182
}
8283

8384
public void setEventListener(EventListener listener) {
@@ -111,7 +112,7 @@ protected Event onEventNative(int eventType, long arg1, long arg2, float argf1)
111112

112113
private final LongSparseArray<RendererItem> index = new LongSparseArray<>();
113114
private synchronized RendererItem insertItemFromEvent(long arg1) {
114-
final RendererItem item = new RendererItem(this, arg1);
115+
final RendererItem item = nativeNewItem(arg1);
115116
index.put(arg1, item);
116117
return item;
117118
}
@@ -138,4 +139,5 @@ private static Description createDescriptionFromNative(String name, String longN
138139
private native boolean nativeStart();
139140
private native void nativeStop();
140141
private static native Description[] nativeList(LibVLC libVLC);
142+
private native RendererItem nativeNewItem(long ref);
141143
}

libvlc/src/main/java/org/videolan/libvlc/RendererItem.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@ public class RendererItem extends VLCObject<RendererItem.Event> {
1515
final int flags;
1616
private final long ref;
1717

18-
RendererItem (RendererDiscoverer rd, long ref) {
19-
super(rd);
20-
final RendererItem item = nativeNewItem(rd, ref);
21-
name = item == null ? null : item.name;
22-
displayName = item == null ? null : item.displayName;
23-
this.type = item == null ? null : item.type;
24-
this.iconUrl = item == null ? null : item.iconUrl;
25-
this.flags = item == null ? 0 : item.flags;
26-
this.ref = item == null ? ref : item.ref;
27-
}
28-
2918
RendererItem(String name, String type, String iconUrl, int flags, long ref) {
3019
final int index = name.lastIndexOf('-');
3120
this.name = name;
@@ -57,6 +46,5 @@ protected Event(int type) {
5746
}
5847
}
5948

60-
private native RendererItem nativeNewItem(RendererDiscoverer rd, long ref);
6149
private native void nativeReleaseItem();
6250
}

libvlc/src/main/java/org/videolan/libvlc/VLCObject.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ public final void release() {
9191
}
9292
}
9393

94+
@Override
95+
protected synchronized void finalize() {
96+
if (!isReleased())
97+
throw new AssertionError("VLCObject (" + getClass().getName() + ") finalized but not natively released (" + mNativeRefCount + " refs)");
98+
}
99+
94100
/**
95101
* Set an event listener.
96102
* Events are sent via the android main thread.

libvlc/src/main/java/org/videolan/libvlc/util/AndroidUtil.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,19 @@
2727

2828
public class AndroidUtil {
2929

30-
public static final boolean isOOrLater = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
31-
public static final boolean isNougatOrLater = isOOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
32-
public static final boolean isMarshMallowOrLater = isNougatOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
33-
public static final boolean isLolliPopOrLater = isMarshMallowOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
34-
public static final boolean isKitKatOrLater = isLolliPopOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
35-
public static final boolean isJellyBeanMR2OrLater = isKitKatOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
36-
public static final boolean isJellyBeanMR1OrLater = isJellyBeanMR2OrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
37-
public static final boolean isJellyBeanOrLater = isJellyBeanMR1OrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
38-
public static final boolean isICSOrLater = isJellyBeanOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
39-
public static final boolean isHoneycombMr2OrLater = isICSOrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2;
40-
public static final boolean isHoneycombMr1OrLater = isHoneycombMr2OrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1;
41-
public static final boolean isHoneycombOrLater = isHoneycombMr1OrLater || Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
30+
public static final boolean isPOrLater = android.os.Build.VERSION.SDK_INT > 27;
31+
public static final boolean isOOrLater = isPOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
32+
public static final boolean isNougatOrLater = isOOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
33+
public static final boolean isMarshMallowOrLater = isNougatOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
34+
public static final boolean isLolliPopOrLater = isMarshMallowOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
35+
public static final boolean isKitKatOrLater = isLolliPopOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
36+
public static final boolean isJellyBeanMR2OrLater = isKitKatOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
37+
public static final boolean isJellyBeanMR1OrLater = isJellyBeanMR2OrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
38+
public static final boolean isJellyBeanOrLater = isJellyBeanMR1OrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
39+
public static final boolean isICSOrLater = isJellyBeanOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
40+
public static final boolean isHoneycombMr2OrLater = isICSOrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2;
41+
public static final boolean isHoneycombMr1OrLater = isHoneycombMr2OrLater || android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1;
42+
public static final boolean isHoneycombOrLater = isHoneycombMr1OrLater || android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB;
4243

4344
public static File UriToFile(Uri uri) {
4445
return new File(uri.getPath().replaceFirst("file://", ""));

libvlc/src/main/java/org/videolan/libvlc/util/VLCUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public static String[] getABIList21() {
6363
@SuppressWarnings("deprecation")
6464
public static String[] getABIList() {
6565
final String[] abis = new String[2];
66-
abis[0] = Build.CPU_ABI;
67-
abis[1] = Build.CPU_ABI2;
66+
abis[0] = android.os.Build.CPU_ABI;
67+
abis[1] = android.os.Build.CPU_ABI2;
6868
return abis;
6969
}
7070

0 commit comments

Comments
 (0)