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

Use HWDecoderUtil.getAudioOutputFromDevice

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