summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/mpeg2ts
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2015-04-09 20:02:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-09 20:02:55 +0000
commite7043b5ec21dbc0e836889840cf3c98faa777e0b (patch)
treeeacb1c2364357b21a6671eada4b7cdcc4f3d5446 /media/libstagefright/mpeg2ts
parent9e11b3da5601e41d64b905e2e6f0545d2ebe5147 (diff)
parentfdbafc0728380645ee2194e2ccfe72b12c65fccf (diff)
downloadframeworks_av-e7043b5ec21dbc0e836889840cf3c98faa777e0b.zip
frameworks_av-e7043b5ec21dbc0e836889840cf3c98faa777e0b.tar.gz
frameworks_av-e7043b5ec21dbc0e836889840cf3c98faa777e0b.tar.bz2
am fdbafc07: am da589e3d: am fc33bb3f: am e686cc09: Merge "Don\'t fail read when "seeking" to current position"
* commit 'fdbafc0728380645ee2194e2ccfe72b12c65fccf': Don't fail read when "seeking" to current position
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-rw-r--r--media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
index 1f43d6d..33cfd1d 100644
--- a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
+++ b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
@@ -85,12 +85,6 @@ status_t MPEG2TSSource::read(
MediaBuffer **out, const ReadOptions *options) {
*out = NULL;
- int64_t seekTimeUs;
- ReadOptions::SeekMode seekMode;
- if (mSeekable && options && options->getSeekTo(&seekTimeUs, &seekMode)) {
- return ERROR_UNSUPPORTED;
- }
-
status_t finalResult;
while (!mImpl->hasBufferAvailable(&finalResult)) {
if (finalResult != OK) {
@@ -103,6 +97,17 @@ status_t MPEG2TSSource::read(
}
}
+ int64_t seekTimeUs;
+ ReadOptions::SeekMode seekMode;
+ if (mSeekable && options && options->getSeekTo(&seekTimeUs, &seekMode)) {
+ // A seek was requested, but we don't actually support seeking and so can only "seek" to
+ // the current position
+ int64_t nextBufTimeUs;
+ if (mImpl->nextBufferTime(&nextBufTimeUs) != OK || seekTimeUs != nextBufTimeUs) {
+ return ERROR_UNSUPPORTED;
+ }
+ }
+
return mImpl->read(out, options);
}