summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInsun Kang <insun@google.com>2012-03-15 23:04:43 +0900
committerInsun Kang <insun@google.com>2012-03-16 16:00:48 +0900
commit7c5afe93c9ca2f9f3958663bc3fa9649ec2f5331 (patch)
tree9feedb389b7a89aed380d5b603355f7359a07d3d
parent49f306f863b14f8bfc3b405ebfd3a2fb2b403c15 (diff)
downloadframeworks_av-7c5afe93c9ca2f9f3958663bc3fa9649ec2f5331.zip
frameworks_av-7c5afe93c9ca2f9f3958663bc3fa9649ec2f5331.tar.gz
frameworks_av-7c5afe93c9ca2f9f3958663bc3fa9649ec2f5331.tar.bz2
Fix a bug in MediaPlayer's addExternalSource().
Change-Id: I035cbfb7acccc7ff88d659861ece7d0f61314fda
-rw-r--r--media/libstagefright/AwesomePlayer.cpp19
-rw-r--r--media/libstagefright/timedtext/TimedTextDriver.cpp2
2 files changed, 4 insertions, 17 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index b4cb1ab..f96a4df 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -2280,16 +2280,8 @@ status_t AwesomePlayer::invoke(const Parcel &request, Parcel *reply) {
mTextDriver = new TimedTextDriver(mListener);
}
// String values written in Parcel are UTF-16 values.
- String16 uri16 = request.readString16();
- const char *uri = NULL;
- if (uri16 != NULL) {
- uri = String8(uri16).string();
- }
- String16 mimeType16 = request.readString16();
- const char *mimeType = NULL;
- if (mimeType16 != NULL) {
- mimeType = String8(mimeType16).string();
- }
+ String8 uri(request.readString16());
+ String8 mimeType(request.readString16());
return mTextDriver->addOutOfBandTextSource(uri, mimeType);
}
case INVOKE_ID_ADD_EXTERNAL_SOURCE_FD:
@@ -2301,12 +2293,7 @@ status_t AwesomePlayer::invoke(const Parcel &request, Parcel *reply) {
int fd = request.readFileDescriptor();
off64_t offset = request.readInt64();
size_t length = request.readInt64();
- String16 mimeType16 = request.readString16();
- const char *mimeType = NULL;
- if (mimeType16 != NULL) {
- mimeType = String8(mimeType16).string();
- }
-
+ String8 mimeType(request.readString16());
return mTextDriver->addOutOfBandTextSource(
fd, offset, length, mimeType);
}
diff --git a/media/libstagefright/timedtext/TimedTextDriver.cpp b/media/libstagefright/timedtext/TimedTextDriver.cpp
index ed83894..8ee15f8 100644
--- a/media/libstagefright/timedtext/TimedTextDriver.cpp
+++ b/media/libstagefright/timedtext/TimedTextDriver.cpp
@@ -175,7 +175,7 @@ status_t TimedTextDriver::addOutOfBandTextSource(
}
sp<TimedTextSource> source;
- if (strcasecmp(mimeType, MEDIA_MIMETYPE_TEXT_SUBRIP)) {
+ if (strcasecmp(mimeType, MEDIA_MIMETYPE_TEXT_SUBRIP) == 0) {
source = TimedTextSource::CreateTimedTextSource(
dataSource, TimedTextSource::OUT_OF_BAND_FILE_SRT);
}