Skip to content

Commit

Permalink
Merge pull request #748 from 3flex/drop-enableHls
Browse files Browse the repository at this point in the history
  • Loading branch information
thornbill authored Jan 25, 2025
2 parents 4f1a0dc + 3d2b52e commit 67ae98a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
31 changes: 11 additions & 20 deletions src/components/deviceprofileBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ import {
} from './codecSupportHelper';

interface ProfileOptions {
enableHls: boolean;
bitrateSetting: number;
}

let profileOptions: ProfileOptions;
let currentDeviceId: DeviceIds;

/**
Expand Down Expand Up @@ -291,18 +289,16 @@ function getTranscodingProfiles(): TranscodingProfile[] {
const hlsAudioCodecs = getSupportedHLSAudioCodecs();
const audioChannels: number = getMaxAudioChannels();

if (profileOptions.enableHls) {
TranscodingProfiles.push({
AudioCodec: hlsAudioCodecs.join(','),
BreakOnNonKeyFrames: false,
Container: 'ts',
Context: EncodingContext.Streaming,
MaxAudioChannels: audioChannels.toString(),
MinSegments: 1,
Protocol: 'hls',
Type: DlnaProfileType.Audio
});
}
TranscodingProfiles.push({
AudioCodec: hlsAudioCodecs.join(','),
BreakOnNonKeyFrames: false,
Container: 'ts',
Context: EncodingContext.Streaming,
MaxAudioChannels: audioChannels.toString(),
MinSegments: 1,
Protocol: 'hls',
Type: DlnaProfileType.Audio
});

const supportedAudio = getSupportedAudioCodecs();

Expand All @@ -325,11 +321,7 @@ function getTranscodingProfiles(): TranscodingProfile[] {

const hlsVideoCodecs = getSupportedHLSVideoCodecs();

if (
hlsVideoCodecs.length &&
hlsAudioCodecs.length &&
profileOptions.enableHls
) {
if (hlsVideoCodecs.length && hlsAudioCodecs.length) {
TranscodingProfiles.push({
AudioCodec: hlsAudioCodecs.join(','),
BreakOnNonKeyFrames: false,
Expand Down Expand Up @@ -388,7 +380,6 @@ function getSubtitleProfiles(): SubtitleProfile[] {
* @returns Device profile.
*/
export function getDeviceProfile(options: ProfileOptions): DeviceProfile {
profileOptions = options;
currentDeviceId = getActiveDeviceId();

// MaxStaticBitrate seems to be for offline sync only
Expand Down
3 changes: 1 addition & 2 deletions src/components/maincontroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ export async function reportDeviceCapabilities(): Promise<void> {
const maxBitrate = await getMaxBitrate();

const deviceProfile = getDeviceProfile({
bitrateSetting: maxBitrate,
enableHls: true
bitrateSetting: maxBitrate
});

hasReportedCapabilities = true;
Expand Down
3 changes: 1 addition & 2 deletions src/components/playbackManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ export abstract class PlaybackManager {

const maxBitrate = await getMaxBitrate();
const deviceProfile = getDeviceProfile({
bitrateSetting: maxBitrate,
enableHls: true
bitrateSetting: maxBitrate
});
let playbackInfo: PlaybackInfoResponse = {};

Expand Down

0 comments on commit 67ae98a

Please sign in to comment.