Commit 1de1ab2c authored by Thomas Guillem's avatar Thomas Guillem

Use HWDecoderUtil.getAudioOutputFromDevice

parent 71e78226
......@@ -318,10 +318,11 @@ public class LibVLC {
}
public void setAout(int aout) {
if (aout == AOUT_OPENSLES && LibVlcUtil.isICSOrLater())
this.aout = AOUT_OPENSLES;
else
this.aout = AOUT_AUDIOTRACK;
final HWDecoderUtil.AudioOutput hwaout = HWDecoderUtil.getAudioOutputFromDevice();
if (hwaout == HWDecoderUtil.AudioOutput.AUDIOTRACK || hwaout == HWDecoderUtil.AudioOutput.OPENSLES)
aout = hwaout == HWDecoderUtil.AudioOutput.OPENSLES ? AOUT_OPENSLES : AOUT_AUDIOTRACK;
this.aout = aout == AOUT_OPENSLES ? AOUT_OPENSLES : AOUT_AUDIOTRACK;
}
public int getVout() {
......
......@@ -20,6 +20,7 @@
package org.videolan.vlc.gui;
import org.videolan.libvlc.HWDecoderUtil;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.LibVlcUtil;
import org.videolan.vlc.MediaDatabase;
......@@ -219,7 +220,12 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
// Audio output
ListPreference aoutPref = (ListPreference) findPreference("aout");
if (LibVlcUtil.isGingerbreadOrLater()) {
final HWDecoderUtil.AudioOutput aout = HWDecoderUtil.getAudioOutputFromDevice();
if (aout == HWDecoderUtil.AudioOutput.AUDIOTRACK || aout == HWDecoderUtil.AudioOutput.OPENSLES) {
/* no AudioOutput choice */
PreferenceGroup group = (PreferenceGroup) findPreference("advanced_prefs_group");
group.removePreference(aoutPref);
} else {
int aoutEntriesId = R.array.aouts;
int aoutEntriesIdValues = R.array.aouts_values;
aoutPref.setEntries(aoutEntriesId);
......@@ -233,10 +239,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
if (intValue != LibVLC.AOUT_AUDIOTRACK && intValue != LibVLC.AOUT_OPENSLES)
aoutPref.setValue(String.valueOf(LibVLC.AOUT_AUDIOTRACK));
}
} else {
/* only audiotrack before gingerbread */
PreferenceGroup group = (PreferenceGroup) findPreference("advanced_prefs_group");
group.removePreference(aoutPref);
}
// Video output
// FIXME : This setting is disable until OpenGL it's fixed
......
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