int64_t OMXCodec::retrieveDecodingTimeUs(bool isCodecSpecific) {
CHECK(mIsEncoder);
- CHECK(!mDecodingTimeList.empty());
+
+ if (mDecodingTimeList.empty()) {
+ CHECK(mNoMoreOutputData);
+ // No corresponding input frame available.
+ // This could happen when EOS is reached.
+ return 0;
+ }
+
List<int64_t>::iterator it = mDecodingTimeList.begin();
int64_t timeUs = *it;
buffer->meta_data()->setInt32(kKeyIsUnreadable, true);
}
- if (mIsEncoder) {
- int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific);
- buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs);
- }
-
buffer->meta_data()->setPointer(
kKeyPlatformPrivate,
msg.u.extended_buffer_data.platform_private);
mNoMoreOutputData = true;
}
+ if (mIsEncoder) {
+ int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific);
+ buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs);
+ }
+
if (mTargetTimeUs >= 0) {
CHECK(msg.u.extended_buffer_data.timestamp <= mTargetTimeUs);