Index: media/filters/audio_renderer_impl.h |
diff --git a/media/filters/audio_renderer_impl.h b/media/filters/audio_renderer_impl.h |
index 47a498b4079ee5f9d59f5fea28c4dbc15ca62980..e9aeece9777ad6132b6966d1ad344415e47431da 100644 |
--- a/media/filters/audio_renderer_impl.h |
+++ b/media/filters/audio_renderer_impl.h |
@@ -23,6 +23,7 @@ |
#include <deque> |
#include "base/synchronization/lock.h" |
+#include "base/threading/thread_checker.h" |
#include "media/base/audio_decoder.h" |
#include "media/base/audio_renderer.h" |
#include "media/base/audio_renderer_sink.h" |
@@ -200,7 +201,10 @@ class MEDIA_EXPORT AudioRendererImpl |
// A flag that indicates this filter is called to stop. |
Ami GONE FROM CHROMIUM
2012/11/01 19:57:01
doco that this must be only read/written on pipeli
DaleCurtis
2012/11/01 22:02:59
Removed.
|
bool stopped_; |
Ami GONE FROM CHROMIUM
2012/11/01 19:57:01
Might be worthwhile to drop stopped_ in favor of c
DaleCurtis
2012/11/01 22:02:59
Done. The new patch set relies on nothing else bei
|
- // The sink (destination) for rendered audio. |
+ // The sink (destination) for rendered audio. |sink_| must only be accessed |
+ // on the pipeline thread (verify with |pipeline_thread_checker_|). |sink_| |
+ // must never be called under |lock_| or the 3-way thread bridge between the |
+ // audio, pipeline, and decoder threads may dead lock. |
scoped_refptr<media::AudioRendererSink> sink_; |
// We're supposed to know amount of audio data OS or hardware buffered, but |
@@ -227,6 +231,9 @@ class MEDIA_EXPORT AudioRendererImpl |
// false otherwise. This flag is cleared on the next Preroll() call. |
bool preroll_aborted_; |
+ // Ensures certain methods are always called on the pipeline thread. |
+ base::ThreadChecker pipeline_thread_checker_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
}; |