diff options
author | Marco Nelissen <marcone@google.com> | 2015-04-03 14:27:33 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2015-04-03 14:27:33 -0700 |
commit | 5d7c3eef1985ff15a56920c548cc4e41d6c9627a (patch) | |
tree | a245ee8e9710f49d8c9574945c41ec762274014c /media/libstagefright/mpeg2ts | |
parent | 3170358336dbe466cd3e9a5517e8e579b47cd084 (diff) | |
download | frameworks_av-5d7c3eef1985ff15a56920c548cc4e41d6c9627a.zip frameworks_av-5d7c3eef1985ff15a56920c548cc4e41d6c9627a.tar.gz frameworks_av-5d7c3eef1985ff15a56920c548cc4e41d6c9627a.tar.bz2 |
Don't fail read when "seeking" to current position
Fixes thumbnails for MPEG2TS files.
Bug: 19583374
Change-Id: I66e5ca014e2f32ba2566c6f511b6e8859d5a97dc
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-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); } |