Skip to content

Commit

Permalink
Really don't request HEVC if unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
PriceChild committed Aug 10, 2024
1 parent ef899f9 commit 45a2455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.jellyfin.androidtv.util.profile.ProfileHelper.max1080pProfileConditio
import org.jellyfin.androidtv.util.profile.ProfileHelper.maxAudioChannelsCodecProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.photoDirectPlayProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.subtitleProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.supportsHevc
import org.jellyfin.apiclient.model.dlna.CodecProfile
import org.jellyfin.apiclient.model.dlna.CodecType
import org.jellyfin.apiclient.model.dlna.DeviceProfile
Expand Down Expand Up @@ -76,7 +77,7 @@ class ExoPlayerProfile(
this.context = EncodingContext.Streaming
container = Codec.Container.TS
videoCodec = buildList {
if (deviceHevcCodecProfile.ContainsCodec(Codec.Video.HEVC, Codec.Container.TS)) add(Codec.Video.HEVC)
if (supportsHevc) add(Codec.Video.HEVC)
add(Codec.Video.H264)
}.joinToString(",")
audioCodec = when (downMixAudio) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ object ProfileHelper {
}
}

val supportsHevc by lazy {
MediaTest.supportsHevc()
}

val deviceHevcCodecProfile by lazy {
CodecProfile().apply {
type = CodecType.Video
Expand Down

0 comments on commit 45a2455

Please sign in to comment.