Add ability to use ExoPlayer's decoder fallback option

This option could help to avoid decoder initialization issues, which falls back
to lower-priority decoders if decoder initialization fails. This may result in
poor playback performance than when using primary decoders.

It is disabled by default, but can be enabled in ExoPlayer settings.
pull/8875/head
AudricV 2022-08-18 18:59:45 +02:00 zatwierdzone przez Stypox
rodzic a4a9957a15
commit 41da8fc05f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
3 zmienionych plików z 13 dodań i 1 usunięć

Wyświetl plik

@ -263,7 +263,9 @@ public final class Player implements PlaybackListener, Listener {
final PlayerDataSource dataSource = new PlayerDataSource(context,
new DefaultBandwidthMeter.Builder(context).build());
loadController = new LoadController();
renderFactory = new DefaultRenderersFactory(context);
renderFactory = new DefaultRenderersFactory(context)
.setEnableDecoderFallback(prefs.getBoolean(
context.getString(R.string.use_exoplayer_decoder_fallback_key), false));
videoResolver = new VideoPlaybackResolver(context, dataSource, getQualityResolver());
audioResolver = new AudioPlaybackResolver(context, dataSource);

Wyświetl plik

@ -1367,5 +1367,7 @@
<string name="streams_notifications_channels_key">streams_notifications_channels</string>
<string name="player_notification_screen_key">player_notification_screen</string>
<!-- ExoPlayer settings -->
<string name="exoplayer_settings_key">exoplayer_settings_key</string>
<string name="use_exoplayer_decoder_fallback_key">use_exoplayer_decoder_fallback_key</string>
</resources>

Wyświetl plik

@ -13,4 +13,12 @@
app:singleLineTitle="false"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="@string/use_exoplayer_decoder_fallback_key"
android:summary="@string/use_exoplayer_decoder_fallback_summary"
android:title="@string/use_exoplayer_decoder_fallback_title"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />
</PreferenceScreen>