浏览代码

one more allow cache fix

Luke Pulverenti 12 年之前
父节点
当前提交
ecbec1f6fd
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      MediaBrowser.Api/Playback/Hls/BaseHlsService.cs

+ 4 - 2
MediaBrowser.Api/Playback/Hls/BaseHlsService.cs

@@ -132,12 +132,14 @@ namespace MediaBrowser.Api.Playback.Hls
             // It's considered live while still encoding (EVENT). Once the encoding has finished, it's video on demand (VOD).
             var playlistType = fileText.IndexOf("#EXT-X-ENDLIST", StringComparison.OrdinalIgnoreCase) == -1 ? "EVENT" : "VOD";
 
+            const string allowCacheAttributeName = "#EXT-X-ALLOW-CACHE";
+
             // fix this to make the media stream validator happy
             // https://ffmpeg.org/trac/ffmpeg/ticket/2228
-            fileText = fileText.Replace("#EXT-X-ALLOWCACHE", "#EXT-X-ALLOW-CACHE");
+            fileText = fileText.Replace("#EXT-X-ALLOWCACHE", allowCacheAttributeName);
 
             // Add event type at the top
-            fileText = fileText.Replace("#EXT-X-ALLOW-CACHE", "#EXT-X-PLAYLIST-TYPE:" + playlistType + Environment.NewLine + "#EXT-X-ALLOWCACHE");
+            fileText = fileText.Replace(allowCacheAttributeName, "#EXT-X-PLAYLIST-TYPE:" + playlistType + Environment.NewLine + allowCacheAttributeName);
     
             return fileText;
         }