소스 검색

Merge pull request #5600 from cvium/fix-hls-defaults-10.7

Fix hls defaults for 10.7
Claus Vium 4 년 전
부모
커밋
25c6388e23

+ 1 - 5
Emby.Dlna/PlayTo/PlayToController.cs

@@ -943,11 +943,7 @@ namespace Emby.Dlna.PlayTo
                 request.DeviceId = values.GetValueOrDefault("DeviceId");
                 request.DeviceId = values.GetValueOrDefault("DeviceId");
                 request.MediaSourceId = values.GetValueOrDefault("MediaSourceId");
                 request.MediaSourceId = values.GetValueOrDefault("MediaSourceId");
                 request.LiveStreamId = values.GetValueOrDefault("LiveStreamId");
                 request.LiveStreamId = values.GetValueOrDefault("LiveStreamId");
-
-                // Be careful, IsDirectStream==true by default (Static != false or not in query).
-                // See initialization of StreamingRequestDto in AudioController.GetAudioStream() method : Static = @static ?? true.
-                request.IsDirectStream = !string.Equals("false", values.GetValueOrDefault("Static"), StringComparison.OrdinalIgnoreCase);
-
+                request.IsDirectStream = string.Equals("true", values.GetValueOrDefault("Static"), StringComparison.OrdinalIgnoreCase);
                 request.AudioStreamIndex = GetIntValue(values, "AudioStreamIndex");
                 request.AudioStreamIndex = GetIntValue(values, "AudioStreamIndex");
                 request.SubtitleStreamIndex = GetIntValue(values, "SubtitleStreamIndex");
                 request.SubtitleStreamIndex = GetIntValue(values, "SubtitleStreamIndex");
                 request.StartPositionTicks = GetLongValue(values, "StartPositionTicks");
                 request.StartPositionTicks = GetLongValue(values, "StartPositionTicks");

+ 12 - 12
Jellyfin.Api/Controllers/AudioController.cs

@@ -144,7 +144,7 @@ namespace Jellyfin.Api.Controllers
             {
             {
                 Id = itemId,
                 Id = itemId,
                 Container = container,
                 Container = container,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -168,7 +168,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -177,13 +177,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,
@@ -309,7 +309,7 @@ namespace Jellyfin.Api.Controllers
             {
             {
                 Id = itemId,
                 Id = itemId,
                 Container = container,
                 Container = container,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -333,7 +333,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -342,13 +342,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,

+ 36 - 36
Jellyfin.Api/Controllers/DynamicHlsController.cs

@@ -226,7 +226,7 @@ namespace Jellyfin.Api.Controllers
             var streamingRequest = new HlsVideoRequestDto
             var streamingRequest = new HlsVideoRequestDto
             {
             {
                 Id = itemId,
                 Id = itemId,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -250,7 +250,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -259,13 +259,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,
@@ -393,7 +393,7 @@ namespace Jellyfin.Api.Controllers
             var streamingRequest = new HlsAudioRequestDto
             var streamingRequest = new HlsAudioRequestDto
             {
             {
                 Id = itemId,
                 Id = itemId,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -417,7 +417,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -426,13 +426,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,
@@ -556,7 +556,7 @@ namespace Jellyfin.Api.Controllers
             var streamingRequest = new VideoRequestDto
             var streamingRequest = new VideoRequestDto
             {
             {
                 Id = itemId,
                 Id = itemId,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -580,7 +580,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -589,13 +589,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,
@@ -721,7 +721,7 @@ namespace Jellyfin.Api.Controllers
             var streamingRequest = new StreamingRequestDto
             var streamingRequest = new StreamingRequestDto
             {
             {
                 Id = itemId,
                 Id = itemId,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -745,7 +745,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -754,13 +754,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,
@@ -891,7 +891,7 @@ namespace Jellyfin.Api.Controllers
             {
             {
                 Id = itemId,
                 Id = itemId,
                 Container = container,
                 Container = container,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -915,7 +915,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -924,13 +924,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,
@@ -1063,7 +1063,7 @@ namespace Jellyfin.Api.Controllers
             {
             {
                 Id = itemId,
                 Id = itemId,
                 Container = container,
                 Container = container,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -1087,7 +1087,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -1096,13 +1096,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,

+ 3 - 3
Jellyfin.Api/Controllers/HlsSegmentController.cs

@@ -66,7 +66,7 @@ namespace Jellyfin.Api.Controllers
             var transcodePath = _serverConfigurationManager.GetTranscodePath();
             var transcodePath = _serverConfigurationManager.GetTranscodePath();
             file = Path.GetFullPath(Path.Combine(transcodePath, file));
             file = Path.GetFullPath(Path.Combine(transcodePath, file));
             var fileDir = Path.GetDirectoryName(file);
             var fileDir = Path.GetDirectoryName(file);
-            if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath))
+            if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath, StringComparison.Ordinal))
             {
             {
                 return BadRequest("Invalid segment.");
                 return BadRequest("Invalid segment.");
             }
             }
@@ -92,7 +92,7 @@ namespace Jellyfin.Api.Controllers
             var transcodePath = _serverConfigurationManager.GetTranscodePath();
             var transcodePath = _serverConfigurationManager.GetTranscodePath();
             file = Path.GetFullPath(Path.Combine(transcodePath, file));
             file = Path.GetFullPath(Path.Combine(transcodePath, file));
             var fileDir = Path.GetDirectoryName(file);
             var fileDir = Path.GetDirectoryName(file);
-            if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath) || Path.GetExtension(file) != ".m3u8")
+            if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath, StringComparison.Ordinal) || Path.GetExtension(file) != ".m3u8")
             {
             {
                 return BadRequest("Invalid segment.");
                 return BadRequest("Invalid segment.");
             }
             }
@@ -146,7 +146,7 @@ namespace Jellyfin.Api.Controllers
 
 
             file = Path.GetFullPath(Path.Combine(transcodeFolderPath, file));
             file = Path.GetFullPath(Path.Combine(transcodeFolderPath, file));
             var fileDir = Path.GetDirectoryName(file);
             var fileDir = Path.GetDirectoryName(file);
-            if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodeFolderPath))
+            if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodeFolderPath, StringComparison.Ordinal))
             {
             {
                 return BadRequest("Invalid segment.");
                 return BadRequest("Invalid segment.");
             }
             }

+ 3 - 3
Jellyfin.Api/Controllers/ImageByNameController.cs

@@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
                 return NotFound();
                 return NotFound();
             }
             }
 
 
-            if (!path.StartsWith(_applicationPaths.GeneralPath))
+            if (!path.StartsWith(_applicationPaths.GeneralPath, StringComparison.Ordinal))
             {
             {
                 return BadRequest("Invalid image path.");
                 return BadRequest("Invalid image path.");
             }
             }
@@ -177,7 +177,7 @@ namespace Jellyfin.Api.Controllers
 
 
                 if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
                 if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
                 {
                 {
-                    if (!path.StartsWith(basePath))
+                    if (!path.StartsWith(basePath, StringComparison.Ordinal))
                     {
                     {
                         return BadRequest("Invalid image path.");
                         return BadRequest("Invalid image path.");
                     }
                     }
@@ -196,7 +196,7 @@ namespace Jellyfin.Api.Controllers
 
 
                 if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
                 if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
                 {
                 {
-                    if (!path.StartsWith(basePath))
+                    if (!path.StartsWith(basePath, StringComparison.Ordinal))
                     {
                     {
                         return BadRequest("Invalid image path.");
                         return BadRequest("Invalid image path.");
                     }
                     }

+ 6 - 6
Jellyfin.Api/Controllers/UniversalAudioController.cs

@@ -219,11 +219,11 @@ namespace Jellyfin.Api.Controllers
                     AudioBitRate = audioBitRate ?? maxStreamingBitrate,
                     AudioBitRate = audioBitRate ?? maxStreamingBitrate,
                     StartTimeTicks = startTimeTicks,
                     StartTimeTicks = startTimeTicks,
                     SubtitleMethod = SubtitleDeliveryMethod.Hls,
                     SubtitleMethod = SubtitleDeliveryMethod.Hls,
-                    RequireAvc = true,
-                    DeInterlace = true,
-                    RequireNonAnamorphic = true,
-                    EnableMpegtsM2TsMode = true,
-                    TranscodeReasons = mediaSource.TranscodeReasons == null ? null : string.Join(",", mediaSource.TranscodeReasons.Select(i => i.ToString()).ToArray()),
+                    RequireAvc = false,
+                    DeInterlace = false,
+                    RequireNonAnamorphic = false,
+                    EnableMpegtsM2TsMode = false,
+                    TranscodeReasons = mediaSource.TranscodeReasons == null ? null : string.Join(',', mediaSource.TranscodeReasons.Select(i => i.ToString()).ToArray()),
                     Context = EncodingContext.Static,
                     Context = EncodingContext.Static,
                     StreamOptions = new Dictionary<string, string>(),
                     StreamOptions = new Dictionary<string, string>(),
                     EnableAdaptiveBitrateStreaming = true
                     EnableAdaptiveBitrateStreaming = true
@@ -251,7 +251,7 @@ namespace Jellyfin.Api.Controllers
                 AudioBitRate = isStatic ? (int?)null : (audioBitRate ?? maxStreamingBitrate),
                 AudioBitRate = isStatic ? (int?)null : (audioBitRate ?? maxStreamingBitrate),
                 MaxAudioBitDepth = maxAudioBitDepth,
                 MaxAudioBitDepth = maxAudioBitDepth,
                 AudioChannels = maxAudioChannels,
                 AudioChannels = maxAudioChannels,
-                CopyTimestamps = true,
+                CopyTimestamps = false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 SubtitleMethod = SubtitleDeliveryMethod.Embed,
                 SubtitleMethod = SubtitleDeliveryMethod.Embed,
                 TranscodeReasons = mediaSource.TranscodeReasons == null ? null : string.Join(",", mediaSource.TranscodeReasons.Select(i => i.ToString()).ToArray()),
                 TranscodeReasons = mediaSource.TranscodeReasons == null ? null : string.Join(",", mediaSource.TranscodeReasons.Select(i => i.ToString()).ToArray()),

+ 6 - 6
Jellyfin.Api/Controllers/VideoHlsController.cs

@@ -224,7 +224,7 @@ namespace Jellyfin.Api.Controllers
             {
             {
                 Id = itemId,
                 Id = itemId,
                 Container = container,
                 Container = container,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -248,7 +248,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -257,13 +257,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,

+ 6 - 6
Jellyfin.Api/Controllers/VideosController.cs

@@ -386,7 +386,7 @@ namespace Jellyfin.Api.Controllers
             {
             {
                 Id = itemId,
                 Id = itemId,
                 Container = container,
                 Container = container,
-                Static = @static ?? true,
+                Static = @static ?? false,
                 Params = @params,
                 Params = @params,
                 Tag = tag,
                 Tag = tag,
                 DeviceProfileId = deviceProfileId,
                 DeviceProfileId = deviceProfileId,
@@ -410,7 +410,7 @@ namespace Jellyfin.Api.Controllers
                 Level = level,
                 Level = level,
                 Framerate = framerate,
                 Framerate = framerate,
                 MaxFramerate = maxFramerate,
                 MaxFramerate = maxFramerate,
-                CopyTimestamps = copyTimestamps ?? true,
+                CopyTimestamps = copyTimestamps ?? false,
                 StartTimeTicks = startTimeTicks,
                 StartTimeTicks = startTimeTicks,
                 Width = width,
                 Width = width,
                 Height = height,
                 Height = height,
@@ -419,13 +419,13 @@ namespace Jellyfin.Api.Controllers
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
                 MaxRefFrames = maxRefFrames,
                 MaxRefFrames = maxRefFrames,
                 MaxVideoBitDepth = maxVideoBitDepth,
                 MaxVideoBitDepth = maxVideoBitDepth,
-                RequireAvc = requireAvc ?? true,
-                DeInterlace = deInterlace ?? true,
-                RequireNonAnamorphic = requireNonAnamorphic ?? true,
+                RequireAvc = requireAvc ?? false,
+                DeInterlace = deInterlace ?? false,
+                RequireNonAnamorphic = requireNonAnamorphic ?? false,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 TranscodingMaxAudioChannels = transcodingMaxAudioChannels,
                 CpuCoreLimit = cpuCoreLimit,
                 CpuCoreLimit = cpuCoreLimit,
                 LiveStreamId = liveStreamId,
                 LiveStreamId = liveStreamId,
-                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? true,
+                EnableMpegtsM2TsMode = enableMpegtsM2TsMode ?? false,
                 VideoCodec = videoCodec,
                 VideoCodec = videoCodec,
                 SubtitleCodec = subtitleCodec,
                 SubtitleCodec = subtitleCodec,
                 TranscodeReasons = transcodeReasons,
                 TranscodeReasons = transcodeReasons,

+ 1 - 3
MediaBrowser.Model/Dlna/StreamInfo.cs

@@ -185,10 +185,8 @@ namespace MediaBrowser.Model.Dlna
                     continue;
                     continue;
                 }
                 }
 
 
-                // Be careful, IsDirectStream==true by default (Static != false or not in query).
-                // See initialization of StreamingRequestDto in AudioController.GetAudioStream() method : Static = @static ?? true.
                 if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
                 if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
-                    string.Equals(pair.Value, "true", StringComparison.OrdinalIgnoreCase))
+                    string.Equals(pair.Value, "false", StringComparison.OrdinalIgnoreCase))
                 {
                 {
                     continue;
                     continue;
                 }
                 }

+ 0 - 55
tests/Jellyfin.Api.Tests/TestAppHost.cs

@@ -1,55 +0,0 @@
-using System.Collections.Generic;
-using System.Reflection;
-using Emby.Server.Implementations;
-using Jellyfin.Server;
-using MediaBrowser.Controller;
-using MediaBrowser.Model.IO;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-
-namespace Jellyfin.Api.Tests
-{
-    /// <summary>
-    /// Implementation of the abstract <see cref="ApplicationHost" /> class.
-    /// </summary>
-    public class TestAppHost : CoreAppHost
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="TestAppHost" /> class.
-        /// </summary>
-        /// <param name="applicationPaths">The <see cref="ServerApplicationPaths" /> to be used by the <see cref="CoreAppHost" />.</param>
-        /// <param name="loggerFactory">The <see cref="ILoggerFactory" /> to be used by the <see cref="CoreAppHost" />.</param>
-        /// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param>
-        /// <param name="startup">The <see cref="IConfiguration" /> to be used by the <see cref="CoreAppHost" />.</param>
-        /// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param>
-        /// <param name="collection">The <see cref="IServiceCollection"/> to be used by the <see cref="CoreAppHost"/>.</param>
-        public TestAppHost(
-            IServerApplicationPaths applicationPaths,
-            ILoggerFactory loggerFactory,
-            IStartupOptions options,
-            IConfiguration startup,
-            IFileSystem fileSystem,
-            IServiceCollection collection)
-            : base(
-                applicationPaths,
-                loggerFactory,
-                options,
-                startup,
-                fileSystem,
-                collection)
-        {
-        }
-
-        /// <inheritdoc />
-        protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
-        {
-            foreach (var a in base.GetAssembliesWithPartsInternal())
-            {
-                yield return a;
-            }
-
-            yield return typeof(TestPlugin).Assembly;
-        }
-    }
-}

+ 2 - 2
tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs

@@ -412,7 +412,7 @@ namespace Jellyfin.Naming.Tests.Video
                 @"/movies/John Wick - Kapitel 3 (2019) [imdbid=tt6146586]/John Wick - Kapitel 3 (2019) [imdbid=tt6146586] - Version 2.mkv"
                 @"/movies/John Wick - Kapitel 3 (2019) [imdbid=tt6146586]/John Wick - Kapitel 3 (2019) [imdbid=tt6146586] - Version 2.mkv"
             };
             };
 
 
-            var result = _videoListResolver.Resolve(files.Select(i => new FileSystemMetadata
+            var result = GetResolver().Resolve(files.Select(i => new FileSystemMetadata
             {
             {
                 IsDirectory = false,
                 IsDirectory = false,
                 FullName = i
                 FullName = i
@@ -432,7 +432,7 @@ namespace Jellyfin.Naming.Tests.Video
                 @"/movies/John Wick - Chapter 3 (2019)/John Wick - Chapter 3 (2019) [Version 2.mkv"
                 @"/movies/John Wick - Chapter 3 (2019)/John Wick - Chapter 3 (2019) [Version 2.mkv"
             };
             };
 
 
-            var result = _videoListResolver.Resolve(files.Select(i => new FileSystemMetadata
+            var result = GetResolver().Resolve(files.Select(i => new FileSystemMetadata
             {
             {
                 IsDirectory = false,
                 IsDirectory = false,
                 FullName = i
                 FullName = i