Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ sealed interface AppPreference<Pref, T> {
summary = R.string.force_dovi_profile_7_summary,
)

val PreferFmp4Container =
AppSwitchPreference<AppPreferences>(
title = R.string.prefer_fmp4_container,
defaultValue = false,
getter = { it.playbackPreferences.overrides.preferFmp4Container },
setter = { prefs, value ->
prefs.updatePlaybackOverrides { preferFmp4Container = value }
},
summaryOn = R.string.enabled,
summaryOff = R.string.disabled,
)

val RememberSelectedTab =
AppSwitchPreference<AppPreferences>(
title = R.string.remember_selected_tab,
Expand Down Expand Up @@ -1004,6 +1016,7 @@ val advancedPreferences =
AppPreference.DirectPlayAss,
AppPreference.DirectPlayPgs,
AppPreference.DirectPlayDoviProfile7,
AppPreference.PreferFmp4Container,
),
),
ConditionalPreferences(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DeviceProfileService
dolbyVisionELDirectPlay = prefs.overrides.directPlayDolbyVisionEL,
jellyfinTenEleven =
serverVersion != null && serverVersion >= ServerVersion(10, 11, 0),
preferFmp4Container = prefs.overrides.preferFmp4Container,
)
if (deviceProfile == null || this@DeviceProfileService.configuration != newConfig) {
this@DeviceProfileService.configuration = newConfig
Expand All @@ -58,6 +59,7 @@ class DeviceProfileService
pgsDirectPlay = newConfig.pgsDirectPlay,
dolbyVisionELDirectPlay = newConfig.dolbyVisionELDirectPlay,
jellyfinTenEleven = newConfig.jellyfinTenEleven,
preferFmp4Container = newConfig.preferFmp4Container,
)
}
this@DeviceProfileService.deviceProfile!!
Expand All @@ -76,4 +78,5 @@ data class DeviceProfileConfiguration(
val pgsDirectPlay: Boolean,
val dolbyVisionELDirectPlay: Boolean,
val jellyfinTenEleven: Boolean,
val preferFmp4Container: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ fun createDeviceProfile(
pgsDirectPlay: Boolean,
dolbyVisionELDirectPlay: Boolean,
jellyfinTenEleven: Boolean,
preferFmp4Container: Boolean,
) = buildDeviceProfile {
val allowedAudioCodecs =
when {
Expand Down Expand Up @@ -128,7 +129,7 @@ fun createDeviceProfile(
type = DlnaProfileType.VIDEO
context = EncodingContext.STREAMING

container = Codec.Container.TS
container = if (preferFmp4Container) Codec.Container.MP4 else Codec.Container.TS
protocol = MediaStreamProtocol.HLS

if (supportsHevc) videoCodec(Codec.Video.HEVC)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/proto/WholphinDataStore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ message PlaybackOverrides{
bool direct_play_pgs = 4;
MediaExtensionStatus media_extensions_enabled = 5;
bool direct_play_dolby_vision_e_l = 6;
bool prefer_fmp4_container = 7;
}

message PlaybackPreferences {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@
<string name="downmix_stereo">Always downmix to stereo</string>
<string name="ffmpeg_extension_pref">Use FFmpeg decoder module</string>
<string name="global_content_scale">Default content scale</string>
<string name="prefer_fmp4_container">Prefer fMP4 container</string>
<string name="install_update">Install update</string>
<string name="installed_version">Installed version</string>
<string name="max_homepage_items">Max items on home page rows</string>
Expand Down