mirror of
https://github.com/androidx/media.git
synced 2025-05-05 06:30:24 +08: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
f4b9042bf0
commit
7ada1a848f
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
* Fix the start of audio getting truncated when transitioning to a new
|
* Fix the start of audio getting truncated when transitioning to a new
|
||||||
item in a playlist of opus streams.
|
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) ###
|
### 2.10.6 (2019-10-17) ###
|
||||||
|
|
||||||
|
@ -445,7 +445,15 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||||||
? Util.getCodecsOfType(variant.format.codecs, C.TRACK_TYPE_AUDIO)
|
? Util.getCodecsOfType(variant.format.codecs, C.TRACK_TYPE_AUDIO)
|
||||||
: null;
|
: null;
|
||||||
sampleMimeType = codecs != null ? MimeTypes.getMediaMimeType(codecs) : 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 =
|
||||||
Format.createAudioContainerFormat(
|
Format.createAudioContainerFormat(
|
||||||
/* id= */ formatId,
|
/* id= */ formatId,
|
||||||
@ -819,13 +827,6 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||||||
return roleFlags;
|
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
|
@Nullable
|
||||||
private static SchemeData parseDrmSchemeData(
|
private static SchemeData parseDrmSchemeData(
|
||||||
String line, String keyFormat, Map<String, String> variableDefinitions)
|
String line, String keyFormat, Map<String, String> variableDefinitions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user