summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-09-28 17:37:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-28 17:37:44 -0700
commitb91d92d7147c10dd19987706d30dea011ff459af (patch)
tree573489126efb8881196f63fe5f8fb0f2d8b42536 /media/libstagefright
parentfb9b87b6c22d940e5e7cb4b5e7cfae99015a0131 (diff)
parentf4d14086206af57fa2d0144e94124fa73be84968 (diff)
downloadframeworks_av-b91d92d7147c10dd19987706d30dea011ff459af.zip
frameworks_av-b91d92d7147c10dd19987706d30dea011ff459af.tar.gz
frameworks_av-b91d92d7147c10dd19987706d30dea011ff459af.tar.bz2
am 387bdcda: am 88a995ed: Merge "Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content." into gingerbread
Merge commit '387bdcdadc312c8e9f702da164bd8bd53cbd92fd' * commit '387bdcdadc312c8e9f702da164bd8bd53cbd92fd': Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content.
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/AudioPlayer.cpp6
-rw-r--r--media/libstagefright/codecs/aacdec/AACDecoder.cpp4
-rw-r--r--media/libstagefright/codecs/mp3dec/MP3Decoder.cpp4
3 files changed, 14 insertions, 0 deletions
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp
index 47a385d..b314114 100644
--- a/media/libstagefright/AudioPlayer.cpp
+++ b/media/libstagefright/AudioPlayer.cpp
@@ -423,6 +423,12 @@ status_t AudioPlayer::seekTo(int64_t time_us) {
mReachedEOS = false;
mSeekTimeUs = time_us;
+ if (mAudioSink != NULL) {
+ mAudioSink->flush();
+ } else {
+ mAudioTrack->flush();
+ }
+
return OK;
}
diff --git a/media/libstagefright/codecs/aacdec/AACDecoder.cpp b/media/libstagefright/codecs/aacdec/AACDecoder.cpp
index e4ed5e6..f58c16d 100644
--- a/media/libstagefright/codecs/aacdec/AACDecoder.cpp
+++ b/media/libstagefright/codecs/aacdec/AACDecoder.cpp
@@ -171,6 +171,10 @@ status_t AACDecoder::read(
mInputBuffer->release();
mInputBuffer = NULL;
}
+
+ // Make sure that the next buffer output does not still
+ // depend on fragments from the last one decoded.
+ PVMP4AudioDecoderResetBuffer(mDecoderBuf);
} else {
seekTimeUs = -1;
}
diff --git a/media/libstagefright/codecs/mp3dec/MP3Decoder.cpp b/media/libstagefright/codecs/mp3dec/MP3Decoder.cpp
index c4a8280..59dd740 100644
--- a/media/libstagefright/codecs/mp3dec/MP3Decoder.cpp
+++ b/media/libstagefright/codecs/mp3dec/MP3Decoder.cpp
@@ -132,6 +132,10 @@ status_t MP3Decoder::read(
mInputBuffer->release();
mInputBuffer = NULL;
}
+
+ // Make sure that the next buffer output does not still
+ // depend on fragments from the last one decoded.
+ pvmp3_InitDecoder(mConfig, mDecoderBuf);
} else {
seekTimeUs = -1;
}