diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-31 00:33:06 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-31 00:33:06 +0000 |
commit | 0a0094e4d08d028df04bffe1ce169379e378c3f0 (patch) | |
tree | db3aa8b5bb5e3a84f53e75e9b94462c480ee45d3 /build | |
parent | fa0cf1acdde214ff05aac75d182210445d8242f8 (diff) | |
download | chromium_src-0a0094e4d08d028df04bffe1ce169379e378c3f0.zip chromium_src-0a0094e4d08d028df04bffe1ce169379e378c3f0.tar.gz chromium_src-0a0094e4d08d028df04bffe1ce169379e378c3f0.tar.bz2 |
Fix a crash in BufferedDataSource
This crash is caused by a race condition when the media
pipeline is shutting down.
Here is a sequence that leads to crash:
1. PipelineImpl::Stop() is called.
2. BufferedDataSource::Stop() is called on pipeline thread.
BufferedDataSource::StopTask() is posted on render thread.
3. BufferedDataSource::StopTask() is executed.
4. BufferedDataSource::Read() is called on demuxer thread.
5. BufferedDataSource::ReadTask() is executed. *bang*
The cause of the crash is the involvement of three threads
and it happens that ReadTask() is executed after StopTask().
Since we cannot prevent BufferedDataSource::Read() being
called by FFmpegDemuxer since the stop signal hasn't arrived
at the demuxer yet. This change will suppress activity of
data source after the stop task executed.
I didn't reuse the |stopped_| variable to suppress activity
but instead introduce another |stop_task_executed_| signal
because |stopped_| is prevent the data source from making
callbacks to the demuxer after stopped has received. And by
doing this we don't need to introduce an additional critical
section which is not desirable.
Review URL: http://codereview.chromium.org/159675
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
0 files changed, 0 insertions, 0 deletions