summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/timedtext/TimedTextSRTSource.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/TimedTextSRTSource.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/TimedTextSRTSource.cpp')
-rw-r--r--media/libstagefright/timedtext/TimedTextSRTSource.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.cpp b/media/libstagefright/timedtext/TimedTextSRTSource.cpp
index c44a99b..7b1f7f6 100644
--- a/media/libstagefright/timedtext/TimedTextSRTSource.cpp
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.cpp
@@ -19,6 +19,7 @@
#include <utils/Log.h>
#include <binder/Parcel.h>
+#include <media/stagefright/foundation/ADebug.h> // for CHECK_xx
#include <media/stagefright/foundation/AString.h>
#include <media/stagefright/DataSource.h>
#include <media/stagefright/MediaDefs.h> // for MEDIA_MIMETYPE_xxx
@@ -63,19 +64,18 @@ status_t TimedTextSRTSource::stop() {
}
status_t TimedTextSRTSource::read(
- int64_t *timeUs,
+ int64_t *startTimeUs,
+ int64_t *endTimeUs,
Parcel *parcel,
const MediaSource::ReadOptions *options) {
- int64_t endTimeUs;
AString text;
- status_t err = getText(options, &text, timeUs, &endTimeUs);
+ status_t err = getText(options, &text, startTimeUs, endTimeUs);
if (err != OK) {
return err;
}
- if (*timeUs > 0) {
- extractAndAppendLocalDescriptions(*timeUs, text, parcel);
- }
+ CHECK_GE(*startTimeUs, 0);
+ extractAndAppendLocalDescriptions(*startTimeUs, text, parcel);
return OK;
}