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
167c2f3f
authored
Jan 23, 2022
by
Dustin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix alignment in track scanner
parent
ec26539a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java
View file @
167c2f3f
...
...
@@ -84,6 +84,14 @@ public class AviExtractor implements Extractor {
//If partial read
private
transient
AviTrack
chunkHandler
;
static
void
alignInput
(
ExtractorInput
input
)
throws
IOException
{
// This isn't documented anywhere, but most files are aligned to even bytes
// and can have gaps of zeros
if
((
input
.
getPosition
()
&
1
)
==
1
)
{
input
.
skipFully
(
1
);
}
}
public
AviExtractor
()
{
this
(
0
);
}
...
...
@@ -406,11 +414,7 @@ public class AviExtractor implements Extractor {
}
else
{
ByteBuffer
byteBuffer
=
allocate
(
8
);
final
byte
[]
bytes
=
byteBuffer
.
array
();
// This isn't documented anywhere, but most files are aligned to even bytes
// and can have gaps of zeros
if
((
input
.
getPosition
()
&
1
)
==
1
)
{
input
.
skipFully
(
1
);
}
alignInput
(
input
);
input
.
readFully
(
bytes
,
0
,
1
);
while
(
bytes
[
0
]
==
0
)
{
input
.
readFully
(
bytes
,
0
,
1
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java
View file @
167c2f3f
...
...
@@ -60,7 +60,7 @@ public class ListBox extends Box {
byte
[]
bytes
=
headerBuffer
.
array
();
input
.
readFully
(
bytes
,
0
,
4
);
final
int
listType
=
headerBuffer
.
getInt
();
//String listTypeName = AviExtractor.toString(listType);
long
endPos
=
input
.
getPosition
()
+
listSize
-
4
;
while
(
input
.
getPosition
()
+
8
<
endPos
)
{
headerBuffer
.
clear
();
...
...
@@ -73,7 +73,7 @@ public class ListBox extends Box {
}
else
{
box
=
boxFactory
.
createBox
(
type
,
size
,
input
);
}
AviExtractor
.
alignInput
(
input
);
if
(
box
!=
null
)
{
list
.
add
(
box
);
}
...
...
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