@ -198,11 +198,11 @@ public class DynamicHlsHelper
var basicPlaylist = AppendPlaylist ( builder , state , playlistUrl , totalBitrate , subtitleGroup ) ;
// Provide a workaround for the case issue between flac and fLaC .
var flacWaPlaylist = ApplyFlacCase Workaround( state , basicPlaylist . ToString ( ) ) ;
if ( ! string . IsNullOrEmpty ( flacWa Playlist) )
// Provide a workaround for alternative codec string capitalization .
var alternativeCodecCapitalizationPlaylist = ApplyCodecCapitalization Workaround( state , basicPlaylist . ToString ( ) ) ;
if ( ! string . IsNullOrEmpty ( alternativeCodecCapitalization Playlist) )
{
builder . Append ( flacWa Playlist) ;
builder . Append ( alternativeCodecCapitalization Playlist) ;
}
if ( state . VideoStream is not null & & state . VideoRequest is not null )
@ -238,11 +238,11 @@ public class DynamicHlsHelper
var sdrTotalBitrate = sdrOutputAudioBitrate + sdrOutputVideoBitrate ;
var sdrPlaylist = AppendPlaylist ( builder , state , sdrVideoUrl , sdrTotalBitrate , subtitleGroup ) ;
// Provide a workaround for the case issue between flac and fLaC .
flacWaPlaylist = ApplyFlacCase Workaround( state , sdrPlaylist . ToString ( ) ) ;
if ( ! string . IsNullOrEmpty ( flacWa Playlist) )
// Provide a workaround for alternative codec string capitalization .
alternativeCodecCapitalizationPlaylist = ApplyCodecCapitalization Workaround( state , sdrPlaylist . ToString ( ) ) ;
if ( ! string . IsNullOrEmpty ( alternativeCodecCapitalization Playlist) )
{
builder . Append ( flacWa Playlist) ;
builder . Append ( alternativeCodecCapitalization Playlist) ;
}
// Restore the video codec
@ -275,11 +275,11 @@ public class DynamicHlsHelper
var newPlaylist = ReplacePlaylistCodecsField ( basicPlaylist , playlistCodecsField , newPlaylistCodecsField ) ;
builder . Append ( newPlaylist ) ;
// Provide a workaround for the case issue between flac and fLaC .
flacWaPlaylist = ApplyFlacCase Workaround( state , newPlaylist ) ;
if ( ! string . IsNullOrEmpty ( flacWa Playlist) )
// Provide a workaround for alternative codec string capitalization .
alternativeCodecCapitalizationPlaylist = ApplyCodecCapitalization Workaround( state , newPlaylist ) ;
if ( ! string . IsNullOrEmpty ( alternativeCodecCapitalization Playlist) )
{
builder . Append ( flacWa Playlist) ;
builder . Append ( alternativeCodecCapitalization Playlist) ;
}
}
}
@ -768,7 +768,7 @@ public class DynamicHlsHelper
StringComparison . Ordinal ) ;
}
private string Apply FlacCase Workaround( StreamState state , string srcPlaylist )
private string Apply CodecCapitalization Workaround( StreamState state , string srcPlaylist )
{
if ( ! string . Equals ( state . ActualOutputAudioCodec , "flac" , StringComparison . OrdinalIgnoreCase ) )
{
@ -779,6 +779,8 @@ public class DynamicHlsHelper
newPlaylist = newPlaylist . Replace ( ",fLaC\"" , ",flac\"" , StringComparison . Ordinal ) ;
newPlaylist = newPlaylist . Replace ( "\"fLaC\"" , "\"flac\"" , StringComparison . Ordinal ) ;
newPlaylist = newPlaylist . Replace ( ",Opus\"" , ",opus\"" , StringComparison . Ordinal ) ;
newPlaylist = newPlaylist . Replace ( "\"Opus\"" , "\"opus\"" , StringComparison . Ordinal ) ;
return string . Equals ( srcPlaylist , newPlaylist , StringComparison . Ordinal ) ? string . Empty : newPlaylist ;
}