mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-22 16:10:31 +00:00
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.
This commit is contained in:
parent
a4a9957a15
commit
41da8fc05f
@ -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);
|
||||
|
@ -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>
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user