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
35a9f263
authored
Jun 30, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use Locale.US in calls to String.format.
Issue: #585
parent
f03e1cd5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
library/src/main/java/com/google/android/exoplayer/dash/mpd/UrlTemplate.java
library/src/main/java/com/google/android/exoplayer/hls/HlsParserUtil.java
library/src/main/java/com/google/android/exoplayer/metadata/Id3Parser.java
library/src/main/java/com/google/android/exoplayer/util/Util.java
library/src/main/java/com/google/android/exoplayer/dash/mpd/UrlTemplate.java
View file @
35a9f263
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer
.
dash
.
mpd
;
package
com
.
google
.
android
.
exoplayer
.
dash
.
mpd
;
import
java.util.Locale
;
/**
/**
* A template from which URLs can be built.
* A template from which URLs can be built.
* <p>
* <p>
...
@@ -85,11 +87,11 @@ public final class UrlTemplate {
...
@@ -85,11 +87,11 @@ public final class UrlTemplate {
if
(
identifiers
[
i
]
==
REPRESENTATION_ID
)
{
if
(
identifiers
[
i
]
==
REPRESENTATION_ID
)
{
builder
.
append
(
representationId
);
builder
.
append
(
representationId
);
}
else
if
(
identifiers
[
i
]
==
NUMBER_ID
)
{
}
else
if
(
identifiers
[
i
]
==
NUMBER_ID
)
{
builder
.
append
(
String
.
format
(
identifierFormatTags
[
i
],
segmentNumber
));
builder
.
append
(
String
.
format
(
Locale
.
US
,
identifierFormatTags
[
i
],
segmentNumber
));
}
else
if
(
identifiers
[
i
]
==
BANDWIDTH_ID
)
{
}
else
if
(
identifiers
[
i
]
==
BANDWIDTH_ID
)
{
builder
.
append
(
String
.
format
(
identifierFormatTags
[
i
],
bandwidth
));
builder
.
append
(
String
.
format
(
Locale
.
US
,
identifierFormatTags
[
i
],
bandwidth
));
}
else
if
(
identifiers
[
i
]
==
TIME_ID
)
{
}
else
if
(
identifiers
[
i
]
==
TIME_ID
)
{
builder
.
append
(
String
.
format
(
identifierFormatTags
[
i
],
time
));
builder
.
append
(
String
.
format
(
Locale
.
US
,
identifierFormatTags
[
i
],
time
));
}
}
}
}
builder
.
append
(
urlPieces
[
identifierCount
]);
builder
.
append
(
urlPieces
[
identifierCount
]);
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsParserUtil.java
View file @
35a9f263
...
@@ -36,7 +36,7 @@ import java.util.regex.Pattern;
...
@@ -36,7 +36,7 @@ import java.util.regex.Pattern;
if
(
matcher
.
find
()
&&
matcher
.
groupCount
()
==
1
)
{
if
(
matcher
.
find
()
&&
matcher
.
groupCount
()
==
1
)
{
return
matcher
.
group
(
1
);
return
matcher
.
group
(
1
);
}
}
throw
new
ParserException
(
String
.
format
(
"Couldn't match %s tag in %s"
,
tag
,
line
)
);
throw
new
ParserException
(
"Couldn't match "
+
tag
+
" tag in "
+
line
);
}
}
public
static
int
parseIntAttr
(
String
line
,
Pattern
pattern
,
String
tag
)
public
static
int
parseIntAttr
(
String
line
,
Pattern
pattern
,
String
tag
)
...
...
library/src/main/java/com/google/android/exoplayer/metadata/Id3Parser.java
View file @
35a9f263
...
@@ -22,6 +22,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
...
@@ -22,6 +22,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -108,7 +109,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> {
...
@@ -108,7 +109,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> {
metadata
.
put
(
GeobMetadata
.
TYPE
,
new
GeobMetadata
(
mimeType
,
filename
,
metadata
.
put
(
GeobMetadata
.
TYPE
,
new
GeobMetadata
(
mimeType
,
filename
,
description
,
objectData
));
description
,
objectData
));
}
else
{
}
else
{
String
type
=
String
.
format
(
"%c%c%c%c"
,
frameId0
,
frameId1
,
frameId2
,
frameId3
);
String
type
=
String
.
format
(
Locale
.
US
,
"%c%c%c%c"
,
frameId0
,
frameId1
,
frameId2
,
frameId3
);
byte
[]
frame
=
new
byte
[
frameSize
];
byte
[]
frame
=
new
byte
[
frameSize
];
id3Data
.
readBytes
(
frame
,
0
,
frameSize
);
id3Data
.
readBytes
(
frame
,
0
,
frameSize
);
metadata
.
put
(
type
,
frame
);
metadata
.
put
(
type
,
frame
);
...
@@ -165,7 +166,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> {
...
@@ -165,7 +166,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> {
int
id2
=
id3Buffer
.
readUnsignedByte
();
int
id2
=
id3Buffer
.
readUnsignedByte
();
int
id3
=
id3Buffer
.
readUnsignedByte
();
int
id3
=
id3Buffer
.
readUnsignedByte
();
if
(
id1
!=
'I'
||
id2
!=
'D'
||
id3
!=
'3'
)
{
if
(
id1
!=
'I'
||
id2
!=
'D'
||
id3
!=
'3'
)
{
throw
new
ParserException
(
String
.
format
(
throw
new
ParserException
(
String
.
format
(
Locale
.
US
,
"Unexpected ID3 file identifier, expected \"ID3\", actual \"%c%c%c\"."
,
id1
,
id2
,
id3
));
"Unexpected ID3 file identifier, expected \"ID3\", actual \"%c%c%c\"."
,
id1
,
id2
,
id3
));
}
}
id3Buffer
.
skipBytes
(
2
);
// Skip version.
id3Buffer
.
skipBytes
(
2
);
// Skip version.
...
...
library/src/main/java/com/google/android/exoplayer/util/Util.java
View file @
35a9f263
...
@@ -573,7 +573,7 @@ public final class Util {
...
@@ -573,7 +573,7 @@ public final class Util {
public
static
String
getHexStringFromBytes
(
byte
[]
data
,
int
beginIndex
,
int
endIndex
)
{
public
static
String
getHexStringFromBytes
(
byte
[]
data
,
int
beginIndex
,
int
endIndex
)
{
StringBuffer
dataStringBuffer
=
new
StringBuffer
(
endIndex
-
beginIndex
);
StringBuffer
dataStringBuffer
=
new
StringBuffer
(
endIndex
-
beginIndex
);
for
(
int
i
=
beginIndex
;
i
<
endIndex
;
i
++)
{
for
(
int
i
=
beginIndex
;
i
<
endIndex
;
i
++)
{
dataStringBuffer
.
append
(
String
.
format
(
"%02X"
,
data
[
i
]));
dataStringBuffer
.
append
(
String
.
format
(
Locale
.
US
,
"%02X"
,
data
[
i
]));
}
}
return
dataStringBuffer
.
toString
();
return
dataStringBuffer
.
toString
();
}
}
...
...
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