|  | @@ -768,11 +768,10 @@ namespace MediaBrowser.Model.Dlna
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      if (ContainerProfile.ContainsContainer(videoCodecs, item.VideoStream?.Codec))
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  | -                        var videoCodec = transcodingProfile.VideoCodec;
 | 
	
		
			
				|  |  | +                        var videoCodec = videoStream?.Codec;
 | 
	
		
			
				|  |  |                          var container = transcodingProfile.Container;
 | 
	
		
			
				|  |  |                          var appliedVideoConditions = options.Profile.CodecProfiles
 | 
	
		
			
				|  |  |                              .Where(i => i.Type == CodecType.Video &&
 | 
	
		
			
				|  |  | -                                (string.IsNullOrEmpty(i.Codec) || string.Equals(i.Codec, videoStream?.Codec, StringComparison.OrdinalIgnoreCase)) &&
 | 
	
		
			
				|  |  |                                  i.ContainsAnyCodec(videoCodec, container) &&
 | 
	
		
			
				|  |  |                                  i.ApplyConditions.All(applyCondition => ConditionProcessor.IsVideoConditionSatisfied(applyCondition, videoStream?.Width, videoStream?.Height, videoStream?.BitDepth, videoStream?.BitRate, videoStream?.Profile, videoStream?.VideoRangeType, videoStream?.Level, videoFramerate, videoStream?.PacketLength, timestamp, videoStream?.IsAnamorphic, videoStream?.IsInterlaced, videoStream?.RefFrames, numVideoStreams, numAudioStreams, videoStream?.CodecTag, videoStream?.IsAVC)))
 | 
	
		
			
				|  |  |                              .Select(i =>
 | 
	
	
		
			
				|  | @@ -906,8 +905,7 @@ namespace MediaBrowser.Model.Dlna
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var appliedVideoConditions = options.Profile.CodecProfiles
 | 
	
		
			
				|  |  |                  .Where(i => i.Type == CodecType.Video &&
 | 
	
		
			
				|  |  | -                    (string.IsNullOrEmpty(i.Codec) || string.Equals(i.Codec, videoStream?.Codec, StringComparison.OrdinalIgnoreCase)) &&
 | 
	
		
			
				|  |  | -                    i.ContainsAnyCodec(videoCodec, container) &&
 | 
	
		
			
				|  |  | +                    i.ContainsAnyCodec(videoStream?.Codec, container) &&
 | 
	
		
			
				|  |  |                      i.ApplyConditions.All(applyCondition => ConditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoRangeType, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)));
 | 
	
		
			
				|  |  |              var isFirstAppliedCodecProfile = true;
 | 
	
		
			
				|  |  |              foreach (var i in appliedVideoConditions)
 | 
	
	
		
			
				|  | @@ -939,8 +937,7 @@ namespace MediaBrowser.Model.Dlna
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var appliedAudioConditions = options.Profile.CodecProfiles
 | 
	
		
			
				|  |  |                  .Where(i => i.Type == CodecType.VideoAudio &&
 | 
	
		
			
				|  |  | -                    (string.IsNullOrEmpty(i.Codec) || string.Equals(i.Codec, audioStream?.Codec, StringComparison.OrdinalIgnoreCase)) &&
 | 
	
		
			
				|  |  | -                    i.ContainsAnyCodec(audioCodec, container) &&
 | 
	
		
			
				|  |  | +                    i.ContainsAnyCodec(audioStream?.Codec, container) &&
 | 
	
		
			
				|  |  |                      i.ApplyConditions.All(applyCondition => ConditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio)));
 | 
	
		
			
				|  |  |              isFirstAppliedCodecProfile = true;
 | 
	
		
			
				|  |  |              foreach (var codecProfile in appliedAudioConditions)
 | 
	
	
		
			
				|  | @@ -1180,7 +1177,6 @@ namespace MediaBrowser.Model.Dlna
 | 
	
		
			
				|  |  |                  "VideoCodecProfile",
 | 
	
		
			
				|  |  |                  profile.CodecProfiles
 | 
	
		
			
				|  |  |                      .Where(codecProfile => codecProfile.Type == CodecType.Video &&
 | 
	
		
			
				|  |  | -                        (string.IsNullOrEmpty(codecProfile.Codec) || string.Equals(codecProfile.Codec, videoStream?.Codec, StringComparison.OrdinalIgnoreCase)) &&
 | 
	
		
			
				|  |  |                          codecProfile.ContainsAnyCodec(videoStream?.Codec, container) &&
 | 
	
		
			
				|  |  |                          !checkVideoConditions(codecProfile.ApplyConditions).Any())
 | 
	
		
			
				|  |  |                      .SelectMany(codecProfile => checkVideoConditions(codecProfile.Conditions)));
 | 
	
	
		
			
				|  | @@ -1591,7 +1587,6 @@ namespace MediaBrowser.Model.Dlna
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              return codecProfiles
 | 
	
		
			
				|  |  |                  .Where(profile => profile.Type == CodecType.VideoAudio &&
 | 
	
		
			
				|  |  | -                    (string.IsNullOrEmpty(profile.Codec) || string.Equals(profile.Codec, codec, StringComparison.OrdinalIgnoreCase)) &&
 | 
	
		
			
				|  |  |                      profile.ContainsAnyCodec(codec, container) &&
 | 
	
		
			
				|  |  |                      profile.ApplyConditions.All(applyCondition => ConditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio)))
 | 
	
		
			
				|  |  |                  .SelectMany(profile => profile.Conditions)
 | 
	
	
		
			
				|  | @@ -1610,7 +1605,6 @@ namespace MediaBrowser.Model.Dlna
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              var conditions = codecProfiles
 | 
	
		
			
				|  |  |                  .Where(profile => profile.Type == CodecType.Audio &&
 | 
	
		
			
				|  |  | -                    (string.IsNullOrEmpty(profile.Codec) || string.Equals(profile.Codec, codec, StringComparison.OrdinalIgnoreCase)) &&
 | 
	
		
			
				|  |  |                      profile.ContainsAnyCodec(codec, container) &&
 | 
	
		
			
				|  |  |                      profile.ApplyConditions.All(applyCondition => ConditionProcessor.IsAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioBitDepth)))
 | 
	
		
			
				|  |  |                  .SelectMany(profile => profile.Conditions);
 |