Bug fix : enqueue one next subtitle for each subtitle.
o Do not enqueue another subtitle when notifying a null message.
related-to-bug: 6401574
Change-Id: I366e643ffa1601c11a12e46fcf7c00a469c77448
diff --git a/media/libstagefright/timedtext/TimedTextPlayer.cpp b/media/libstagefright/timedtext/TimedTextPlayer.cpp
index dc5f6b8..f855d90 100644
--- a/media/libstagefright/timedtext/TimedTextPlayer.cpp
+++ b/media/libstagefright/timedtext/TimedTextPlayer.cpp
@@ -112,15 +112,14 @@
break;
}
sp<RefBase> obj;
- msg->findObject("subtitle", &obj);
- if (obj != NULL) {
+ if (msg->findObject("subtitle", &obj)) {
sp<ParcelEvent> parcelEvent;
parcelEvent = static_cast<ParcelEvent*>(obj.get());
notifyListener(&(parcelEvent->parcel));
+ doRead();
} else {
notifyListener();
}
- doRead();
break;
}
case kWhatSetSource: {