nuplayer: Do not notify EOS when paused

Playback switches to next clip if a paused clip is seeked to EOS.
This happens as onDrainAudioQueue is allowed to fill buffer
when paused. During drain, EOS is notified even during paused state
and playback switches to next clip.

Avoid notifying EOS when paused.

authored-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
Test: run mediaplayer
Bug: 38022556
Change-Id: I8261219615f4ce726e03d02b0cb3e71889a711d0
(cherry picked from commit b99e3649f468015f5156e71d02b11c2e2c236c58)
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 9fe61703..5775b43 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -1010,6 +1010,13 @@
             }
 
             // EOS
+            if (mPaused) {
+                // Do not notify EOS when paused.
+                // This is needed to avoid switch to next clip while in pause.
+                ALOGV("onDrainAudioQueue(): Do not notify EOS when paused");
+                return false;
+            }
+
             int64_t postEOSDelayUs = 0;
             if (mAudioSink->needsTrailingPadding()) {
                 postEOSDelayUs = getPendingAudioPlayoutDurationUs(ALooper::GetNowUs());