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

Side by Side Diff: media/ffmpeg/ffmpeg_common.cc

Issue 10825014: Test variable against constant instead of simply testing constant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ffmpeg/ffmpeg_common.h" 5 #include "media/ffmpeg/ffmpeg_common.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // for now, but may not always be true forever. Fix this in the future. 241 // for now, but may not always be true forever. Fix this in the future.
242 gfx::Rect visible_rect(stream->codec->width, stream->codec->height); 242 gfx::Rect visible_rect(stream->codec->width, stream->codec->height);
243 243
244 AVRational aspect_ratio = { 1, 1 }; 244 AVRational aspect_ratio = { 1, 1 };
245 if (stream->sample_aspect_ratio.num) 245 if (stream->sample_aspect_ratio.num)
246 aspect_ratio = stream->sample_aspect_ratio; 246 aspect_ratio = stream->sample_aspect_ratio;
247 else if (stream->codec->sample_aspect_ratio.num) 247 else if (stream->codec->sample_aspect_ratio.num)
248 aspect_ratio = stream->codec->sample_aspect_ratio; 248 aspect_ratio = stream->codec->sample_aspect_ratio;
249 249
250 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id); 250 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id);
251 VideoCodecProfile profile = kCodecVP8 ? VP8PROFILE_MAIN : 251 VideoCodecProfile profile = (codec == kCodecVP8) ? VP8PROFILE_MAIN :
252 ProfileIDToVideoCodecProfile(stream->codec->profile); 252 ProfileIDToVideoCodecProfile(stream->codec->profile);
253 config->Initialize(codec, 253 config->Initialize(codec,
254 profile, 254 profile,
255 PixelFormatToVideoFormat(stream->codec->pix_fmt), 255 PixelFormatToVideoFormat(stream->codec->pix_fmt),
256 coded_size, visible_rect, 256 coded_size, visible_rect,
257 stream->r_frame_rate.num, 257 stream->r_frame_rate.num,
258 stream->r_frame_rate.den, 258 stream->r_frame_rate.den,
259 aspect_ratio.num, 259 aspect_ratio.num,
260 aspect_ratio.den, 260 aspect_ratio.den,
261 stream->codec->extradata, 261 stream->codec->extradata,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 avcodec_close(stream->codec); 384 avcodec_close(stream->codec);
385 } 385 }
386 } 386 }
387 } 387 }
388 388
389 // Then finally cleanup the format context. 389 // Then finally cleanup the format context.
390 avformat_close_input(&format_context); 390 avformat_close_input(&format_context);
391 } 391 }
392 392
393 } // namespace media 393 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698