Browse Source

ps4 dlna fixes

Luke Pulverenti 8 năm trước cách đây
mục cha
commit
14af8211eb

+ 16 - 4
Emby.Dlna/Didl/DidlBuilder.cs

@@ -176,6 +176,18 @@ namespace Emby.Dlna.Didl
             return new NullLogger();
         }
 
+        private string GetMimeType(string input)
+        {
+            var mime = MimeTypes.GetMimeType(input);
+
+            if (string.Equals(mime, "video/mp2t", StringComparison.OrdinalIgnoreCase))
+            {
+                mime = "video/mpeg";
+            }
+
+            return mime;
+        }
+
         private void AddVideoResource(DlnaOptions options, XmlWriter writer, IHasMediaSources video, string deviceId, Filter filter, StreamInfo streamInfo = null)
         {
             if (streamInfo == null)
@@ -360,7 +372,7 @@ namespace Emby.Dlna.Didl
             var filename = url.Substring(0, url.IndexOf('?'));
 
             var mimeType = mediaProfile == null || string.IsNullOrEmpty(mediaProfile.MimeType)
-               ? MimeTypes.GetMimeType(filename)
+               ? GetMimeType(filename)
                : mediaProfile.MimeType;
 
             writer.WriteAttributeString("protocolInfo", String.Format(
@@ -481,7 +493,7 @@ namespace Emby.Dlna.Didl
             var filename = url.Substring(0, url.IndexOf('?'));
 
             var mimeType = mediaProfile == null || string.IsNullOrEmpty(mediaProfile.MimeType)
-                ? MimeTypes.GetMimeType(filename)
+                ? GetMimeType(filename)
                 : mediaProfile.MimeType;
 
             var contentFeatures = new ContentFeatureBuilder(_profile).BuildAudioHeader(streamInfo.Container,
@@ -760,7 +772,7 @@ namespace Emby.Dlna.Didl
 
             // Seeing some LG models locking up due content with large lists of people
             // The actual issue might just be due to processing a more metadata than it can handle
-            var limit = 10;
+            var limit = 6;
 
             foreach (var actor in people)
             {
@@ -1007,7 +1019,7 @@ namespace Emby.Dlna.Didl
 
             writer.WriteAttributeString("protocolInfo", String.Format(
                 "http-get:*:{0}:{1}",
-                MimeTypes.GetMimeType("file." + format),
+                GetMimeType("file." + format),
                 contentFeatures
                 ));
 

+ 1 - 16
Emby.Dlna/Profiles/DishHopperJoeyProfile.cs

@@ -63,22 +63,7 @@ namespace Emby.Dlna.Profiles
 
                 new DirectPlayProfile
                 {
-                    Container = "mp3",
-                    AudioCodec = "mp3",
-                    Type = DlnaProfileType.Audio
-                },
-
-                new DirectPlayProfile
-                {
-                    Container = "alac",
-                    AudioCodec = "alac",
-                    Type = DlnaProfileType.Audio
-                },
-
-                new DirectPlayProfile
-                {
-                    Container = "flac",
-                    AudioCodec = "flac",
+                    Container = "mp3,alac,flac",
                     Type = DlnaProfileType.Audio
                 },
 

+ 3 - 1
Emby.Dlna/Profiles/SonyPs4Profile.cs

@@ -86,7 +86,9 @@ namespace Emby.Dlna.Profiles
                 {
                     Container = "mp3",
                     AudioCodec = "mp3",
-                    Type = DlnaProfileType.Audio
+                    Type = DlnaProfileType.Audio,
+                    // Transcoded audio won't be playable at all without this
+                    TranscodeSeekInfo = TranscodeSeekInfo.Bytes
                 },
                 new TranscodingProfile
                 {

+ 1 - 3
Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml

@@ -37,9 +37,7 @@
   <XmlRootAttributes />
   <DirectPlayProfiles>
     <DirectPlayProfile container="mp4,mkv,mpeg,ts" audioCodec="mp3,ac3,aac,he-aac,pcm" videoCodec="h264,mpeg2video" type="Video" />
-    <DirectPlayProfile container="mp3" audioCodec="mp3" type="Audio" />
-    <DirectPlayProfile container="alac" audioCodec="alac" type="Audio" />
-    <DirectPlayProfile container="flac" audioCodec="flac" type="Audio" />
+    <DirectPlayProfile container="mp3,alac,flac" type="Audio" />
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>

+ 1 - 1
Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml

@@ -45,7 +45,7 @@
     <DirectPlayProfile container="jpeg,png,gif,bmp,tiff" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Bytes" copyTimestamps="false" context="Streaming" enableSubtitlesInManifest="false" />
     <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" enableSubtitlesInManifest="false" />
     <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>