diff options
author | Marco Nelissen <marcone@google.com> | 2015-04-09 19:37:57 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-09 19:37:57 +0000 |
commit | fc33bb3f7474c45eca4de112ccf048150a9112f6 (patch) | |
tree | 2599aaa849ebf6d243181d927db01eb5ca16d8d0 /media | |
parent | 8c6f1d972aa71806d67a220081d0031b91c09a8c (diff) | |
parent | e686cc0952176964684ce2487c5170e41d03c057 (diff) | |
download | frameworks_av-fc33bb3f7474c45eca4de112ccf048150a9112f6.zip frameworks_av-fc33bb3f7474c45eca4de112ccf048150a9112f6.tar.gz frameworks_av-fc33bb3f7474c45eca4de112ccf048150a9112f6.tar.bz2 |
am e686cc09: Merge "Don\'t fail read when "seeking" to current position"
* commit 'e686cc0952176964684ce2487c5170e41d03c057':
Don't fail read when "seeking" to current position
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp | 17 |
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); } |