Fix the broken fMP4 main playlist (#7263)

This commit is contained in:
Nyanmisaka 2022-02-02 05:30:19 +08:00 committed by GitHub
parent 6af7d5445f
commit 6c53420fe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ public class DynamicHlsPlaylistGenerator : IDynamicHlsPlaylistGenerator
var segmentExtension = EncodingHelper.GetSegmentFileExtension(request.SegmentContainer);
// http://ffmpeg.org/ffmpeg-all.html#toc-hls-2
var isHlsInFmp4 = string.Equals(segmentExtension, "mp4", StringComparison.OrdinalIgnoreCase);
var isHlsInFmp4 = string.Equals(segmentExtension, ".mp4", StringComparison.OrdinalIgnoreCase);
var hlsVersion = isHlsInFmp4 ? "7" : "3";
var builder = new StringBuilder(128);
@ -65,11 +65,14 @@ public class DynamicHlsPlaylistGenerator : IDynamicHlsPlaylistGenerator
if (isHlsInFmp4)
{
// Init file that only includes fMP4 headers
builder.Append("#EXT-X-MAP:URI=\"")
.Append(request.EndpointPrefix)
.Append("-1")
.Append(segmentExtension)
.Append(request.QueryString)
.Append("&runtimeTicks=0")
.Append("&actualSegmentLengthTicks=0")
.Append('"')
.AppendLine();
}