Chromium Code Reviews| Index: media/filters/chunk_demuxer.cc |
| diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
| index af7927bdc0cb4d394f17ab2d593822e3b7ddfa4c..d49701355f67b3d53f036b58f934a95cd7eeed15 100644 |
| --- a/media/filters/chunk_demuxer.cc |
| +++ b/media/filters/chunk_demuxer.cc |
| @@ -27,7 +27,8 @@ struct CodecInfo { |
| DemuxerStream::Type type; |
| }; |
| -typedef StreamParser* (*ParserFactoryFunction)(); |
| +typedef StreamParser* (*ParserFactoryFunction)( |
| + const std::vector<std::string>& codecs); |
| struct SupportedTypeInfo { |
| const char* type; |
| @@ -49,7 +50,7 @@ static const CodecInfo* kAudioWebMCodecs[] = { |
| NULL |
| }; |
| -static StreamParser* BuildWebMParser() { |
| +static StreamParser* BuildWebMParser(const std::vector<std::string>& codecs) { |
| return new WebMStreamParser(); |
| } |
| @@ -68,8 +69,16 @@ static const CodecInfo* kAudioMP4Codecs[] = { |
| NULL |
| }; |
| -static StreamParser* BuildMP4Parser() { |
| - return new mp4::MP4StreamParser(); |
| +static StreamParser* BuildMP4Parser(const std::vector<std::string>& codecs) { |
| + bool has_sbr = false; |
| + for (size_t i = 0; i < codecs.size(); ++i) { |
| + if (codecs[i] == "mp4a.40.5") { |
|
vrk (LEFT CHROMIUM)
2012/07/20 23:08:48
nit: put string in a constant?
acolwell GONE FROM CHROMIUM
2012/07/20 23:20:05
Done.
|
| + has_sbr = true; |
| + break; |
| + } |
| + } |
| + |
| + return new mp4::MP4StreamParser(has_sbr); |
| } |
| #endif |
| @@ -639,7 +648,7 @@ ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id, |
| base::Unretained(this)); |
| } |
| - scoped_ptr<StreamParser> stream_parser(factory_function()); |
| + scoped_ptr<StreamParser> stream_parser(factory_function(codecs)); |
| CHECK(stream_parser.get()); |
| stream_parser->Init( |