diff options
author | James Dong <jdong@google.com> | 2010-03-04 23:00:21 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-03-04 23:00:21 -0800 |
commit | 62abc71a7ae63099e6d345ad474def2d6199db33 (patch) | |
tree | 640f9fca4d6d54f9961ad6a06de1804f452e96e6 | |
parent | fe5c20c9b209c48ded8a1ceee510b75046f46e6a (diff) | |
download | opencore-62abc71a7ae63099e6d345ad474def2d6199db33.tar.gz |
Fix a software decoder freeze issue
OpenCore's software decoders are all using 2 output buffers.
Holding more than 1 buffer in the video MIO can lead to starvation
and playback freeze.
bug - 2478420
-rw-r--r-- | android/android_surface_output.cpp | 2 | ||||
-rw-r--r-- | android/android_surface_output.h | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/android/android_surface_output.cpp b/android/android_surface_output.cpp index 5538f8c15..9f0ad3208 100644 --- a/android/android_surface_output.cpp +++ b/android/android_surface_output.cpp @@ -48,7 +48,7 @@ OSCL_EXPORT_REF AndroidSurfaceOutput::AndroidSurfaceOutput() : mPvPlayer = NULL; mEmulation = false; iEosReceived = false; - mNumberOfFramesToHold = 2; + mNumberOfFramesToHold = 1; } status_t AndroidSurfaceOutput::set(PVPlayer* pvPlayer, const sp<ISurface>& surface, bool emulation) diff --git a/android/android_surface_output.h b/android/android_surface_output.h index f8ca4ff76..5f0f734c3 100644 --- a/android/android_surface_output.h +++ b/android/android_surface_output.h @@ -315,14 +315,15 @@ protected: bool iIsMIOConfigured; /* - * The value of mNumberOfFramesToHold is hardware/platform specific. - * 1. On non-overlay based platforms, its value it set to 2 - * so as to avoid potential tearings oberved during video playback. - * 2. On overlay-based platforms, its value should be overwritten. - * We have observed video decoder starvation when a value other than 1. + * The value of mNumberOfFramesToHold is decoder specific. + * + * Please make sure that the number of unique output buffers from the decoder + * (either hardware or software) is not less than 1 + mNumberOfFramesToHold; + * otherwise, we will have starvation. + * + * On some platforms, mNumberOfFramesToHold needs to set to more than 1 (such as + * 2) in order to workaround a tearing issue from SF during video playback. * - * We set the default value to 2 in this class. Please change its value - * accordingly in the derived class. */ int mNumberOfFramesToHold; |