Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fabd4705
authored
Mar 12, 2015
by
ojw28
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #354 from canatella/aes-iv-fix
Fix AES decryption of HLS streams.
parents
5ca2e0fd
94dd9c41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java
library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java
View file @
fabd4705
...
...
@@ -233,9 +233,6 @@ public final class HlsPlaylistParser implements NetworkLoadable.Parser<HlsPlayli
segmentEncryptionKeyUri
=
HlsParserUtil
.
parseStringAttr
(
line
,
URI_ATTR_REGEX
,
URI_ATTR
);
segmentEncryptionIV
=
HlsParserUtil
.
parseOptionalStringAttr
(
line
,
IV_ATTR_REGEX
);
if
(
segmentEncryptionIV
==
null
)
{
segmentEncryptionIV
=
Integer
.
toHexString
(
segmentMediaSequence
);
}
}
}
else
if
(
line
.
startsWith
(
BYTERANGE_TAG
))
{
String
byteRange
=
HlsParserUtil
.
parseStringAttr
(
line
,
BYTERANGE_REGEX
,
BYTERANGE_TAG
);
...
...
@@ -247,13 +244,21 @@ public final class HlsPlaylistParser implements NetworkLoadable.Parser<HlsPlayli
}
else
if
(
line
.
equals
(
DISCONTINUITY_TAG
))
{
segmentDiscontinuity
=
true
;
}
else
if
(!
line
.
startsWith
(
"#"
))
{
String
thisSegmentEncryptionIV
;
if
(
segmentEncryptionIV
!=
null
)
{
thisSegmentEncryptionIV
=
segmentEncryptionIV
;
}
else
if
(
HlsMediaPlaylist
.
ENCRYPTION_METHOD_AES_128
.
equals
(
segmentEncryptionMethod
))
{
thisSegmentEncryptionIV
=
Integer
.
toHexString
(
segmentMediaSequence
);
}
else
{
thisSegmentEncryptionIV
=
null
;
}
segmentMediaSequence
++;
if
(
segmentByterangeLength
==
C
.
LENGTH_UNBOUNDED
)
{
segmentByterangeOffset
=
0
;
}
segments
.
add
(
new
Segment
(
line
,
segmentDurationSecs
,
segmentDiscontinuity
,
segmentStartTimeUs
,
segmentEncryptionMethod
,
segmentEncryptionKeyUri
,
s
egmentEncryptionIV
,
segmentByterangeOffset
,
segmentByterangeLength
));
thisS
egmentEncryptionIV
,
segmentByterangeOffset
,
segmentByterangeLength
));
segmentStartTimeUs
+=
(
long
)
(
segmentDurationSecs
*
C
.
MICROS_PER_SECOND
);
segmentDiscontinuity
=
false
;
segmentDurationSecs
=
0.0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment