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
88fa1495
authored
Jan 22, 2016
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use consistent naming for Xing headers/tags.
Also fix a couple of style nits.
parent
cef1f12f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
library/src/androidTest/java/com/google/android/exoplayer/extractor/mp3/XingSeekerTest.java
library/src/main/java/com/google/android/exoplayer/extractor/mp3/Mp3Extractor.java
library/src/main/java/com/google/android/exoplayer/extractor/mp3/XingSeeker.java
library/src/main/java/com/google/android/exoplayer/util/MpegAudioHeader.java
library/src/androidTest/java/com/google/android/exoplayer/extractor/mp3/XingSeekerTest.java
View file @
88fa1495
...
@@ -23,11 +23,11 @@ import com.google.android.exoplayer.util.ParsableByteArray;
...
@@ -23,11 +23,11 @@ import com.google.android.exoplayer.util.ParsableByteArray;
import
android.test.InstrumentationTestCase
;
import
android.test.InstrumentationTestCase
;
/**
/**
* Tests for {@link XingSeeker}
* Tests for {@link XingSeeker}
.
*/
*/
public
final
class
XingSeekerTest
extends
InstrumentationTestCase
{
public
final
class
XingSeekerTest
extends
InstrumentationTestCase
{
// X
ING
header/payload from http://storage.googleapis.com/exoplayer-test-media-0/play.mp3.
// X
ing
header/payload from http://storage.googleapis.com/exoplayer-test-media-0/play.mp3.
private
static
final
int
XING_FRAME_HEADER_DATA
=
0xFFFB3000
;
private
static
final
int
XING_FRAME_HEADER_DATA
=
0xFFFB3000
;
private
static
final
byte
[]
XING_FRAME_PAYLOAD
=
TestUtil
.
createByteArray
(
private
static
final
byte
[]
XING_FRAME_PAYLOAD
=
TestUtil
.
createByteArray
(
"00000007000008dd000e7919000205080a0d0f1214171a1c1e212426292c2e303336383b3d404245484a4c4f5254"
"00000007000008dd000e7919000205080a0d0f1214171a1c1e212426292c2e303336383b3d404245484a4c4f5254"
...
...
library/src/main/java/com/google/android/exoplayer/extractor/mp3/Mp3Extractor.java
View file @
88fa1495
...
@@ -328,7 +328,7 @@ public final class Mp3Extractor implements Extractor {
...
@@ -328,7 +328,7 @@ public final class Mp3Extractor implements Extractor {
*/
*/
private
void
setupSeeker
(
ExtractorInput
extractorInput
,
long
headerPosition
)
private
void
setupSeeker
(
ExtractorInput
extractorInput
,
long
headerPosition
)
throws
IOException
,
InterruptedException
{
throws
IOException
,
InterruptedException
{
// Try to set up seeking based on a X
ING
or VBRI header.
// Try to set up seeking based on a X
ing
or VBRI header.
ParsableByteArray
frame
=
new
ParsableByteArray
(
synchronizedHeader
.
frameSize
);
ParsableByteArray
frame
=
new
ParsableByteArray
(
synchronizedHeader
.
frameSize
);
extractorInput
.
peekFully
(
frame
.
data
,
0
,
synchronizedHeader
.
frameSize
);
extractorInput
.
peekFully
(
frame
.
data
,
0
,
synchronizedHeader
.
frameSize
);
if
(
parseSeekerFrame
(
frame
,
headerPosition
,
extractorInput
.
getLength
()))
{
if
(
parseSeekerFrame
(
frame
,
headerPosition
,
extractorInput
.
getLength
()))
{
...
...
library/src/main/java/com/google/android/exoplayer/extractor/mp3/XingSeeker.java
View file @
88fa1495
...
@@ -21,7 +21,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
...
@@ -21,7 +21,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
import
com.google.android.exoplayer.util.Util
;
import
com.google.android.exoplayer.util.Util
;
/**
/**
* MP3 seeker that uses metadata from a X
ING
header.
* MP3 seeker that uses metadata from a X
ing
header.
*/
*/
/* package */
final
class
XingSeeker
implements
Mp3Extractor
.
Seeker
{
/* package */
final
class
XingSeeker
implements
Mp3Extractor
.
Seeker
{
...
@@ -32,7 +32,7 @@ import com.google.android.exoplayer.util.Util;
...
@@ -32,7 +32,7 @@ import com.google.android.exoplayer.util.Util;
*
*
* @param mpegAudioHeader The MPEG audio header associated with the frame.
* @param mpegAudioHeader The MPEG audio header associated with the frame.
* @param frame The data in this audio frame, with its position set to immediately after the
* @param frame The data in this audio frame, with its position set to immediately after the
* 'X
ING' or 'INFO
' tag.
* 'X
ing' or 'Info
' tag.
* @param position The position (byte offset) of the start of this frame in the stream.
* @param position The position (byte offset) of the start of this frame in the stream.
* @param inputLength The length of the stream in bytes.
* @param inputLength The length of the stream in bytes.
* @return A {@link XingSeeker} for seeking in the stream, or {@code null} if the required
* @return A {@link XingSeeker} for seeking in the stream, or {@code null} if the required
...
...
library/src/main/java/com/google/android/exoplayer/util/MpegAudioHeader.java
View file @
88fa1495
...
@@ -191,8 +191,8 @@ public final class MpegAudioHeader {
...
@@ -191,8 +191,8 @@ public final class MpegAudioHeader {
/** Number of samples stored in the frame. */
/** Number of samples stored in the frame. */
public
int
samplesPerFrame
;
public
int
samplesPerFrame
;
private
void
setValues
(
int
version
,
String
mimeType
,
int
frameSize
,
private
void
setValues
(
int
version
,
String
mimeType
,
int
frameSize
,
int
sampleRate
,
int
channels
,
int
sampleRate
,
int
channels
,
int
bitrate
,
int
samplesPerFrame
)
{
int
bitrate
,
int
samplesPerFrame
)
{
this
.
version
=
version
;
this
.
version
=
version
;
this
.
mimeType
=
mimeType
;
this
.
mimeType
=
mimeType
;
this
.
frameSize
=
frameSize
;
this
.
frameSize
=
frameSize
;
...
...
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