mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Fix detection of Dolby Atmos in HLS
E-AC3 with JOC is signaled using the CHANNELS attribute for HLS: https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendices PiperOrigin-RevId: 277680300
This commit is contained in:
parent
149ea90541
commit
fbea71b0fe
2 changed files with 10 additions and 8 deletions
|
|
@ -105,6 +105,7 @@
|
|||
* Deprecate the GVR extension.
|
||||
* Fix the start of audio getting truncated when transitioning to a new
|
||||
item in a playlist of opus streams.
|
||||
* Fix detection of Dolby Atmos in HLS to match the HLS authoring specification.
|
||||
|
||||
### 2.10.6 (2019-10-17) ###
|
||||
|
||||
|
|
|
|||
|
|
@ -452,7 +452,15 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||
? Util.getCodecsOfType(variant.format.codecs, C.TRACK_TYPE_AUDIO)
|
||||
: null;
|
||||
sampleMimeType = codecs != null ? MimeTypes.getMediaMimeType(codecs) : null;
|
||||
int channelCount = parseChannelsAttribute(line, variableDefinitions);
|
||||
String channelsString =
|
||||
parseOptionalStringAttr(line, REGEX_CHANNELS, variableDefinitions);
|
||||
int channelCount = Format.NO_VALUE;
|
||||
if (channelsString != null) {
|
||||
channelCount = Integer.parseInt(Util.splitAtFirst(channelsString, "/")[0]);
|
||||
if (MimeTypes.AUDIO_E_AC3.equals(sampleMimeType) && channelsString.endsWith("/JOC")) {
|
||||
sampleMimeType = MimeTypes.AUDIO_E_AC3_JOC;
|
||||
}
|
||||
}
|
||||
format =
|
||||
Format.createAudioContainerFormat(
|
||||
/* id= */ formatId,
|
||||
|
|
@ -828,13 +836,6 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||
return roleFlags;
|
||||
}
|
||||
|
||||
private static int parseChannelsAttribute(String line, Map<String, String> variableDefinitions) {
|
||||
String channelsString = parseOptionalStringAttr(line, REGEX_CHANNELS, variableDefinitions);
|
||||
return channelsString != null
|
||||
? Integer.parseInt(Util.splitAtFirst(channelsString, "/")[0])
|
||||
: Format.NO_VALUE;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static SchemeData parseDrmSchemeData(
|
||||
String line, String keyFormat, Map<String, String> variableDefinitions)
|
||||
|
|
|
|||
Loading…
Reference in a new issue