Fix TTML codec string in HLS.

Issue #903

Change-Id: I1f73d16ad79c2593996d7d50f9556984302fe21e
This commit is contained in:
Jacob Trimble 2021-02-25 16:17:00 -08:00
parent 025e10de69
commit f0a52cbbf2
1 changed files with 11 additions and 3 deletions

View File

@ -85,6 +85,13 @@ std::set<std::string> GetGroupCodecString(
if (wvtt != codecs.end()) {
codecs.erase(wvtt);
}
// TTML is specified using 'stpp.ttml.im1t'; see section 5.10 of
// https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices
auto ttml = codecs.find("ttml");
if (ttml != codecs.end()) {
codecs.erase(ttml);
codecs.insert("stpp.ttml.im1t");
}
return codecs;
}
@ -225,7 +232,8 @@ void BuildStreamInfTag(const MediaPlaylist& playlist,
// Right now the frame-rate returned may not be accurate in some scenarios.
// TODO(kqyang): Fix frame-rate computation.
const bool is_iframe_playlist = playlist.stream_type() ==
const bool is_iframe_playlist =
playlist.stream_type() ==
MediaPlaylist::MediaPlaylistStreamType::kVideoIFramesOnly;
if (!is_iframe_playlist) {
const double frame_rate = playlist.GetFrameRate();