summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-11-05 13:07:39 -0800
committerMarco Nelissen <marcone@google.com>2014-11-05 14:38:29 -0800
commit15ce5f35187659ad757ee2ea6f70dcef5010c2c2 (patch)
tree4fa8715305099f3aac2087de867fe80a529b8599 /media
parent8bfa96c2f7c098550b00b84677088f84e81f4ed4 (diff)
downloadframeworks_av-15ce5f35187659ad757ee2ea6f70dcef5010c2c2.zip
frameworks_av-15ce5f35187659ad757ee2ea6f70dcef5010c2c2.tar.gz
frameworks_av-15ce5f35187659ad757ee2ea6f70dcef5010c2c2.tar.bz2
Fix short sound playback
AudioTrack needs to be stopped, not paused, at the end of the file, since otherwise the last bit of queued up audio will not be played. Bug: 18188921 Change-Id: I038aad74a105e163963929c7002b55f377de1442
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 86ce385..97d2942 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -629,6 +629,10 @@ bool NuPlayer::Renderer::onDrainAudioQueue() {
mAudioQueue.erase(mAudioQueue.begin());
entry = NULL;
+ // Need to stop the track here, because that will play out the last
+ // little bit at the end of the file. Otherwise short files won't play.
+ mAudioSink->stop();
+ mNumFramesWritten = 0;
return false;
}