Commit 645e32af authored by Thomas Guillem's avatar Thomas Guillem

LibVLC: add a method to activate spdif and surround

parent 4c3e3aa4
...@@ -461,7 +461,10 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz) ...@@ -461,7 +461,10 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
(*env)->ReleaseStringUTFChars(env, cachePath, cache_path); (*env)->ReleaseStringUTFChars(env, cachePath, cache_path);
} }
#define MAX_ARGV 20 methodId = (*env)->GetMethodID(env, cls, "isHdmiAudioEnabled", "()Z");
bool hdmi_audio = (*env)->CallBooleanMethod(env, thiz, methodId);
#define MAX_ARGV 22
const char *argv[MAX_ARGV]; const char *argv[MAX_ARGV];
int argc = 0; int argc = 0;
...@@ -500,7 +503,11 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz) ...@@ -500,7 +503,11 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
argv[argc++] = "--no-omxil-dr"; argv[argc++] = "--no-omxil-dr";
#endif #endif
} }
argv[argc++] = "--spdif"; if (hdmi_audio) {
argv[argc++] = "--spdif";
argv[argc++] = "--audiotrack-audio-channels";
argv[argc++] = "8"; // 7.1 maximum
}
argv[argc++] = b_verbose ? "-vvv" : "-vv"; argv[argc++] = b_verbose ? "-vvv" : "-vv";
/* Reconnect on lost HTTP streams, e.g. network change */ /* Reconnect on lost HTTP streams, e.g. network change */
......
...@@ -86,6 +86,7 @@ public class LibVLC { ...@@ -86,6 +86,7 @@ public class LibVLC {
private boolean frameSkip = false; private boolean frameSkip = false;
private int networkCaching = 0; private int networkCaching = 0;
private boolean httpReconnect = false; private boolean httpReconnect = false;
private boolean hdmiAudioEnabled = false;
/** Path of application-specific cache */ /** Path of application-specific cache */
private String mCachePath = ""; private String mCachePath = "";
...@@ -338,6 +339,14 @@ public class LibVLC { ...@@ -338,6 +339,14 @@ public class LibVLC {
this.vout = VOUT_ANDROID_WINDOW; this.vout = VOUT_ANDROID_WINDOW;
} }
public void setHdmiAudioEnabled(boolean enable) {
this.hdmiAudioEnabled = enable;
}
public boolean isHdmiAudioEnabled() {
return this.hdmiAudioEnabled;
}
public boolean useCompatSurface() { public boolean useCompatSurface() {
return this.vout != VOUT_ANDROID_WINDOW; return this.vout != VOUT_ANDROID_WINDOW;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment