summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-06-10 14:18:12 -0700
committerLajos Molnar <lajos@google.com>2015-06-10 14:42:02 -0700
commit984a54322f7c70bc75e862d91bdd975814872aff (patch)
treeedcbac98c9b3f0197b588f109fd7b331567afd77 /media/libstagefright/ACodec.cpp
parent4599da7f4ca67a323aa64d84c1b79e3ce6ab9f41 (diff)
downloadframeworks_av-984a54322f7c70bc75e862d91bdd975814872aff.zip
frameworks_av-984a54322f7c70bc75e862d91bdd975814872aff.tar.gz
frameworks_av-984a54322f7c70bc75e862d91bdd975814872aff.tar.bz2
stagefright: fix issues with OMX message passing
- added destructor for MessageList so messages are freed - check if notify has been initialized - do not call onMessages if there are no messages Bug: 21659665 Change-Id: Idb4eaa63dc2f8be8b282be79e6234f83a7669481
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index a57d4cf..cf37eba 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -110,6 +110,8 @@ static void InitOMXParams(T *params) {
struct MessageList : public RefBase {
MessageList() {
}
+ virtual ~MessageList() {
+ }
std::list<sp<AMessage> > &getList() { return mList; }
private:
std::list<sp<AMessage> > mList;
@@ -126,15 +128,19 @@ struct CodecObserver : public BnOMXObserver {
// from IOMXObserver
virtual void onMessages(const std::list<omx_message> &messages) {
- sp<AMessage> notify;
+ if (messages.empty()) {
+ return;
+ }
+
+ sp<AMessage> notify = mNotify->dup();
bool first = true;
sp<MessageList> msgList = new MessageList();
for (std::list<omx_message>::const_iterator it = messages.cbegin();
it != messages.cend(); ++it) {
const omx_message &omx_msg = *it;
if (first) {
- notify = mNotify->dup();
notify->setInt32("node", omx_msg.node);
+ first = false;
}
sp<AMessage> msg = new AMessage;