From 5295c0c55d41a2906ea7f65a3f22e6278cb17d4b Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 23 Feb 2010 13:45:33 -0800 Subject: 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 --- media/libstagefright/MPEG4Extractor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'media/libstagefright/MPEG4Extractor.cpp') 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; } -- cgit v1.1