summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Extractor.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-02-23 13:45:33 -0800
committerAndreas Huber <andih@google.com>2010-02-23 14:06:38 -0800
commit5295c0c55d41a2906ea7f65a3f22e6278cb17d4b (patch)
tree98a85c677c483627a1e9c1a2955fd7c58d90b7a8 /media/libstagefright/MPEG4Extractor.cpp
parentbd5d93f21e6f79c6d9ebe9d77542c3090d4a7ff4 (diff)
downloadframeworks_av-5295c0c55d41a2906ea7f65a3f22e6278cb17d4b.zip
frameworks_av-5295c0c55d41a2906ea7f65a3f22e6278cb17d4b.tar.gz
frameworks_av-5295c0c55d41a2906ea7f65a3f22e6278cb17d4b.tar.bz2
Propagate errors all the way through the MediaSources and send either MEDIA_PLAYBACK_COMPLETE or MEDIA_ERROR depending on the final reason for running out of buffers to play back.
related-to-bug: 2463749
Diffstat (limited to 'media/libstagefright/MPEG4Extractor.cpp')
-rw-r--r--media/libstagefright/MPEG4Extractor.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index a6053b3..165ac09 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1450,6 +1450,14 @@ status_t MPEG4Source::read(
&sampleIndex, SampleTable::kSyncSample_Flag);
if (err != OK) {
+ if (err == ERROR_OUT_OF_RANGE) {
+ // An attempt to seek past the end of the stream would
+ // normally cause this ERROR_OUT_OF_RANGE error. Propagating
+ // this all the way to the MediaPlayer would cause abnormal
+ // termination. Legacy behaviour appears to be to behave as if
+ // we had seeked to the end of stream, ending normally.
+ err = ERROR_END_OF_STREAM;
+ }
return err;
}