Reduce memory usage by some extractors.

Occurs for some extractors that use shared memory without MediaBufferObserver.
Check with high resolution MKV.

Play a mkv file continuously and check file descriptor count.
adb shell lsof | grep mediae | wc
adb shell lsof | grep medias | wc

Test: Photos with mkv.
Bug: 36359517
Change-Id: I8719b628406a838ee091499347b219a8a4736a25
Signed-off-by: yuedl1 <yuedl1@lenovo.com>
diff --git a/media/libmedia/IMediaSource.cpp b/media/libmedia/IMediaSource.cpp
index fdbc869..724b3a0 100644
--- a/media/libmedia/IMediaSource.cpp
+++ b/media/libmedia/IMediaSource.cpp
@@ -389,7 +389,7 @@
                     }
                 }
                 if (transferBuf != nullptr) { // Using shared buffers.
-                    if (!transferBuf->isObserved()) {
+                    if (!transferBuf->isObserved() && transferBuf != buf) {
                         // Transfer buffer must be part of a MediaBufferGroup.
                         ALOGV("adding shared memory buffer %p to local group", transferBuf);
                         mGroup->add_buffer(transferBuf);