diff options
author | Insun Kang <insun@google.com> | 2012-03-27 15:38:43 +0900 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-04-13 13:55:24 -0700 |
commit | 25736fd247ba757feefe15d3071f7e747c64fea4 (patch) | |
tree | 3e28d7c387df9a96a63a454270c68f1b13e918cb | |
parent | db9b87e30a2ffe71554150e33066738ab134bc3c (diff) | |
download | frameworks_av-25736fd247ba757feefe15d3071f7e747c64fea4.zip frameworks_av-25736fd247ba757feefe15d3071f7e747c64fea4.tar.gz frameworks_av-25736fd247ba757feefe15d3071f7e747c64fea4.tar.bz2 |
To return default track info even if there's no metadata for a
subtitle track.
It would rather return empty data than return NULL data for an existing track.
Change-Id: Ie0c18e6851bfbe2c471041589670a3012605b584
-rw-r--r-- | media/libstagefright/timedtext/TimedTextDriver.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/media/libstagefright/timedtext/TimedTextDriver.cpp b/media/libstagefright/timedtext/TimedTextDriver.cpp index 7aad11b..a99d882 100644 --- a/media/libstagefright/timedtext/TimedTextDriver.cpp +++ b/media/libstagefright/timedtext/TimedTextDriver.cpp @@ -214,19 +214,18 @@ void TimedTextDriver::getTrackInfo(Parcel *parcel) { for (iter = mTextSourceVector.begin(); iter != mTextSourceVector.end(); ++iter) { sp<MetaData> meta = (*iter)->getFormat(); - if (meta != NULL) { - // There are two fields. - parcel->writeInt32(2); - // track type. - parcel->writeInt32(MEDIA_TRACK_TYPE_TIMEDTEXT); + // There are two fields. + parcel->writeInt32(2); + + // track type. + parcel->writeInt32(MEDIA_TRACK_TYPE_TIMEDTEXT); - const char *lang = "und"; + const char *lang = "und"; + if (meta != NULL) { meta->findCString(kKeyMediaLanguage, &lang); - parcel->writeString16(String16(lang)); - } else { - parcel->writeInt32(0); } + parcel->writeString16(String16(lang)); } } |