Skip to content

Commit 73af55a

Browse files
committed
Fixed backward compatibility
1 parent d34ec86 commit 73af55a

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpeg.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.github.hiteshsondhi88.libffmpeg;
22

3+
import android.content.Context;
34
import android.text.TextUtils;
45

56
import java.lang.reflect.Array;
@@ -32,6 +33,19 @@ public static FFmpeg getInstance(FFmpegContextProvider contextProvider) {
3233
return instance;
3334
}
3435

36+
@Deprecated
37+
public static FFmpeg getInstance(final Context context) {
38+
if (instance == null) {
39+
instance = new FFmpeg(new FFmpegContextProvider() {
40+
@Override
41+
public Context provide() {
42+
return context;
43+
}
44+
});
45+
}
46+
return instance;
47+
}
48+
3549
@Override
3650
public void loadBinary(FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler) throws FFmpegNotSupportedException {
3751
String cpuArchNameFromAssets = null;
@@ -71,7 +85,7 @@ public void execute(Map<String, String> environvenmentVars, String[] cmd, FFmpeg
7185
}
7286
}
7387

74-
public <T> T[] concatenate (T[] a, T[] b) {
88+
private static <T> T[] concatenate (T[] a, T[] b) {
7589
int aLen = a.length;
7690
int bLen = b.length;
7791

FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/Util.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@ public void run() {
102102
try {
103103
readyToProceed = predicate.isReadyToProceed();
104104
} catch (Exception e) {
105-
Log.v("Observing " + e.getMessage());
105+
// Log.v("Observing " + e.getMessage());
106106
observer.postDelayed(this, 40);
107107
return;
108108
}
109109

110110
if (readyToProceed != null && readyToProceed) {
111-
Log.v("Observed");
111+
// Log.v("Observed");
112112
run.run();
113113
} else {
114114
// Enable this to detect neverending observers
115115
// Log.v("Util", "Observing", e);
116-
Log.v("Observing");
116+
// Log.v("Observing");
117117
observer.postDelayed(this, 40);
118118
}
119119
}

0 commit comments

Comments
 (0)