Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: media/filters/stream_parser_factory.cc

Issue 413393006: Fix two uninitialized variables in media (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style nits mostly back to ps2 Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/formats/mp4/box_definitions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/stream_parser_factory.h" 5 #include "media/filters/stream_parser_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return new WebMStreamParser(); 98 return new WebMStreamParser();
99 } 99 }
100 100
101 #if defined(USE_PROPRIETARY_CODECS) 101 #if defined(USE_PROPRIETARY_CODECS)
102 // AAC Object Type IDs that Chrome supports. 102 // AAC Object Type IDs that Chrome supports.
103 static const int kAACLCObjectType = 2; 103 static const int kAACLCObjectType = 2;
104 static const int kAACSBRObjectType = 5; 104 static const int kAACSBRObjectType = 5;
105 105
106 static int GetMP4AudioObjectType(const std::string& codec_id, 106 static int GetMP4AudioObjectType(const std::string& codec_id,
107 const LogCB& log_cb) { 107 const LogCB& log_cb) {
108 int audio_object_type;
109 std::vector<std::string> tokens; 108 std::vector<std::string> tokens;
110 if (Tokenize(codec_id, ".", &tokens) != 3 || 109 if (Tokenize(codec_id, ".", &tokens) == 3 &&
111 tokens[0] != "mp4a" || tokens[1] != "40" || 110 tokens[0] == "mp4a" && tokens[1] == "40") {
112 !base::HexStringToInt(tokens[2], &audio_object_type)) { 111 int audio_object_type;
113 MEDIA_LOG(log_cb) << "Malformed mimetype codec '" << codec_id << "'"; 112 if (base::HexStringToInt(tokens[2], &audio_object_type))
114 return -1; 113 return audio_object_type;
115 } 114 }
116 115
117 116 MEDIA_LOG(log_cb) << "Malformed mimetype codec '" << codec_id << "'";
118 return audio_object_type; 117 return -1;
119 } 118 }
120 119
121 bool ValidateMP4ACodecID(const std::string& codec_id, const LogCB& log_cb) { 120 bool ValidateMP4ACodecID(const std::string& codec_id, const LogCB& log_cb) {
122 int audio_object_type = GetMP4AudioObjectType(codec_id, log_cb); 121 int audio_object_type = GetMP4AudioObjectType(codec_id, log_cb);
123 if (audio_object_type == kAACLCObjectType || 122 if (audio_object_type == kAACLCObjectType ||
124 audio_object_type == kAACSBRObjectType) { 123 audio_object_type == kAACSBRObjectType) {
125 return true; 124 return true;
126 } 125 }
127 126
128 MEDIA_LOG(log_cb) << "Unsupported audio object type " 127 MEDIA_LOG(log_cb) << "Unsupported audio object type "
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 CodecInfo::HISTOGRAM_MAX + 1); 405 CodecInfo::HISTOGRAM_MAX + 1);
407 } 406 }
408 407
409 stream_parser.reset(factory_function(codecs, log_cb)); 408 stream_parser.reset(factory_function(codecs, log_cb));
410 } 409 }
411 410
412 return stream_parser.Pass(); 411 return stream_parser.Pass();
413 } 412 }
414 413
415 } // namespace media 414 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/formats/mp4/box_definitions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698