| Index: media/base/filter_collection.cc
|
| diff --git a/media/base/filter_collection.cc b/media/base/filter_collection.cc
|
| index 42f42d05201bb6afaf71e8e032578a1332d3e09a..2a38f802409f0faf0bfc9a3336f2c1ff1d8edbc2 100644
|
| --- a/media/base/filter_collection.cc
|
| +++ b/media/base/filter_collection.cc
|
| @@ -5,6 +5,7 @@
|
| #include "media/base/filter_collection.h"
|
|
|
| #include "base/logging.h"
|
| +#include "media/base/audio_decoder.h"
|
|
|
| namespace media {
|
|
|
| @@ -25,8 +26,8 @@ void FilterCollection::AddVideoDecoder(VideoDecoder* filter) {
|
| AddFilter(VIDEO_DECODER, filter);
|
| }
|
|
|
| -void FilterCollection::AddAudioDecoder(AudioDecoder* filter) {
|
| - AddFilter(AUDIO_DECODER, filter);
|
| +void FilterCollection::AddAudioDecoder(AudioDecoder* audio_decoder) {
|
| + audio_decoders_.push_back(audio_decoder);
|
| }
|
|
|
| void FilterCollection::AddVideoRenderer(VideoRenderer* filter) {
|
| @@ -38,11 +39,12 @@ void FilterCollection::AddAudioRenderer(AudioRenderer* filter) {
|
| }
|
|
|
| bool FilterCollection::IsEmpty() const {
|
| - return filters_.empty();
|
| + return filters_.empty() && audio_decoders_.empty();
|
| }
|
|
|
| void FilterCollection::Clear() {
|
| filters_.clear();
|
| + audio_decoders_.clear();
|
| }
|
|
|
| void FilterCollection::SelectVideoDecoder(
|
| @@ -50,9 +52,13 @@ void FilterCollection::SelectVideoDecoder(
|
| SelectFilter<VIDEO_DECODER>(filter_out);
|
| }
|
|
|
| -void FilterCollection::SelectAudioDecoder(
|
| - scoped_refptr<AudioDecoder>* filter_out) {
|
| - SelectFilter<AUDIO_DECODER>(filter_out);
|
| +void FilterCollection::SelectAudioDecoder(scoped_refptr<AudioDecoder>* out) {
|
| + if (audio_decoders_.empty()) {
|
| + *out = NULL;
|
| + return;
|
| + }
|
| + *out = audio_decoders_.front();
|
| + audio_decoders_.pop_front();
|
| }
|
|
|
| void FilterCollection::SelectVideoRenderer(
|
|
|