From 456fa912e46edf0b01ea3b7760ea922c01ca1866 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Fri, 7 Feb 2014 09:32:44 -0800 Subject: fix delay when shutting down wifi display RepeaterSource needs to stop SurfaceMediaSource before stopping its looper, otherwise the stop could get queued behind the last read(), which will not return until a new frame comes. Change SurfaceMediaSource stop to signal frame avalable first, so that its read() returns EOS to reader upon stop. Bug: 11677087 Change-Id: Ie331cc8c7f4824fd3930f3e909b53db4463902fb --- media/libstagefright/wifi-display/source/RepeaterSource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/wifi-display') diff --git a/media/libstagefright/wifi-display/source/RepeaterSource.cpp b/media/libstagefright/wifi-display/source/RepeaterSource.cpp index cc8dee3..59d7e6e 100644 --- a/media/libstagefright/wifi-display/source/RepeaterSource.cpp +++ b/media/libstagefright/wifi-display/source/RepeaterSource.cpp @@ -79,6 +79,8 @@ status_t RepeaterSource::stop() { ALOGV("stopping"); + status_t err = mSource->stop(); + if (mLooper != NULL) { mLooper->stop(); mLooper.clear(); @@ -92,7 +94,6 @@ status_t RepeaterSource::stop() { mBuffer = NULL; } - status_t err = mSource->stop(); ALOGV("stopped"); -- cgit v1.1