summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/timedtext/TimedText3GPPSource.cpp
diff options
context:
space:
mode:
authorInsun Kang <insun@google.com>2012-03-14 08:16:35 +0900
committerInsun Kang <insun@google.com>2012-03-21 10:44:04 +0900
commitbae00e73c6d1d87cc5fd42b50f95d1d9572162ea (patch)
tree23f0936dc8ce1c2167fbba1b9f1c2d9de7044f7e /media/libstagefright/timedtext/TimedText3GPPSource.cpp
parent1bb8e81b066a2311fd238fc6dae8f026e33ed99e (diff)
downloadframeworks_av-bae00e73c6d1d87cc5fd42b50f95d1d9572162ea.zip
frameworks_av-bae00e73c6d1d87cc5fd42b50f95d1d9572162ea.tar.gz
frameworks_av-bae00e73c6d1d87cc5fd42b50f95d1d9572162ea.tar.bz2
Handling end times of subtitles.
Change-Id: Ic19ec8980d0a2bf9f265d375cd56e638a2460af8
Diffstat (limited to 'media/libstagefright/timedtext/TimedText3GPPSource.cpp')
-rw-r--r--media/libstagefright/timedtext/TimedText3GPPSource.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/media/libstagefright/timedtext/TimedText3GPPSource.cpp b/media/libstagefright/timedtext/TimedText3GPPSource.cpp
index c423ef0..4854121 100644
--- a/media/libstagefright/timedtext/TimedText3GPPSource.cpp
+++ b/media/libstagefright/timedtext/TimedText3GPPSource.cpp
@@ -39,19 +39,21 @@ TimedText3GPPSource::~TimedText3GPPSource() {
}
status_t TimedText3GPPSource::read(
- int64_t *timeUs, Parcel *parcel, const MediaSource::ReadOptions *options) {
+ int64_t *startTimeUs, int64_t *endTimeUs, Parcel *parcel,
+ const MediaSource::ReadOptions *options) {
MediaBuffer *textBuffer = NULL;
status_t err = mSource->read(&textBuffer, options);
if (err != OK) {
return err;
}
CHECK(textBuffer != NULL);
- textBuffer->meta_data()->findInt64(kKeyTime, timeUs);
- // TODO: this is legacy code. when 'timeUs' can be <= 0?
- if (*timeUs > 0) {
- extractAndAppendLocalDescriptions(*timeUs, textBuffer, parcel);
- }
+ textBuffer->meta_data()->findInt64(kKeyTime, startTimeUs);
+ CHECK_GE(*startTimeUs, 0);
+ extractAndAppendLocalDescriptions(*startTimeUs, textBuffer, parcel);
textBuffer->release();
+ // endTimeUs is a dummy parameter for 3gpp timed text format.
+ // Set a negative value to it to mark it is unavailable.
+ *endTimeUs = -1;
return OK;
}