OSDN Git Service

AwesomePlayer: fix concurrent pause and teardown
authorEric Laurent <elaurent@google.com>
Tue, 15 Oct 2013 23:11:24 +0000 (16:11 -0700)
committerEric Laurent <elaurent@google.com>
Tue, 15 Oct 2013 23:11:24 +0000 (16:11 -0700)
commitd576687570f19f3956d91c1d3da10d965e34c407
tree4f19e79cf537bed5827e9c144b4823133248f338
parent014e7fa2e90827d911c37bb0ce4d2e10e14d0bb3
AwesomePlayer: fix concurrent pause and teardown

There was a race condition if a pause request was received
while we were executing a teardown event. Although we hold
a mutex while processing the teardown event, there is a step
of the prepare sequence where we release the mutex if streaming.
In this case, the pause request is executed but ignored because
the player state is still preparing. At the end of the teardown
event processing we restore previous playback state and resume.

The fix consists in clearing the saved teardown playback state
when a pause request is received while processing a teardown event.

Bug: 11225491.
Change-Id: If0e61855ce5a336322f1ba8e5559bdc190beeb76
media/libstagefright/AwesomePlayer.cpp