summaryrefslogtreecommitdiffstats
path: root/media/ffmpeg/ffmpeg_common.cc
diff options
context:
space:
mode:
authordalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 22:32:14 +0000
committerdalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 22:32:14 +0000
commit859b463585079cc5c4f5b6ae97602988538aeeec (patch)
tree2d03dc61a3f77a4aa5a6b5f212c3e8691527dbd9 /media/ffmpeg/ffmpeg_common.cc
parent3e1c8fedc6c736caf16ad356d6e99768da49f47c (diff)
downloadchromium_src-859b463585079cc5c4f5b6ae97602988538aeeec.zip
chromium_src-859b463585079cc5c4f5b6ae97602988538aeeec.tar.gz
chromium_src-859b463585079cc5c4f5b6ae97602988538aeeec.tar.bz2
Second attempt to land ffmpeg roll.
Attempt 2 at landing http://codereview.chromium.org/9317096/ Same as before except for fixes in checkperms/ However, fixes have landed elsewhere for: - mp3 decode issue. - FrameRateNoVsyncCanvasInternalTest.fishbowl/0 BUG=110776 TEST=unittests, layouttests, trybots, perf tests... Review URL: https://chromiumcodereview.appspot.com/9447029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/ffmpeg/ffmpeg_common.cc')
-rw-r--r--media/ffmpeg/ffmpeg_common.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 4fc7f4e..978aff0 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -178,14 +178,14 @@ void AVCodecContextToAudioDecoderConfig(
DCHECK_EQ(codec_context->codec_type, AVMEDIA_TYPE_AUDIO);
AudioCodec codec = CodecIDToAudioCodec(codec_context->codec_id);
- int bits_per_channel = av_get_bits_per_sample_fmt(codec_context->sample_fmt);
+ int bytes_per_channel = av_get_bytes_per_sample(codec_context->sample_fmt);
ChannelLayout channel_layout =
ChannelLayoutToChromeChannelLayout(codec_context->channel_layout,
codec_context->channels);
int samples_per_second = codec_context->sample_rate;
config->Initialize(codec,
- bits_per_channel,
+ bytes_per_channel << 3,
channel_layout,
samples_per_second,
codec_context->extradata,
@@ -289,35 +289,35 @@ void VideoDecoderConfigToAVCodecContext(
ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout,
int channels) {
switch (layout) {
- case CH_LAYOUT_MONO:
+ case AV_CH_LAYOUT_MONO:
return CHANNEL_LAYOUT_MONO;
- case CH_LAYOUT_STEREO:
+ case AV_CH_LAYOUT_STEREO:
return CHANNEL_LAYOUT_STEREO;
- case CH_LAYOUT_2_1:
+ case AV_CH_LAYOUT_2_1:
return CHANNEL_LAYOUT_2_1;
- case CH_LAYOUT_SURROUND:
+ case AV_CH_LAYOUT_SURROUND:
return CHANNEL_LAYOUT_SURROUND;
- case CH_LAYOUT_4POINT0:
+ case AV_CH_LAYOUT_4POINT0:
return CHANNEL_LAYOUT_4POINT0;
- case CH_LAYOUT_2_2:
+ case AV_CH_LAYOUT_2_2:
return CHANNEL_LAYOUT_2_2;
- case CH_LAYOUT_QUAD:
+ case AV_CH_LAYOUT_QUAD:
return CHANNEL_LAYOUT_QUAD;
- case CH_LAYOUT_5POINT0:
+ case AV_CH_LAYOUT_5POINT0:
return CHANNEL_LAYOUT_5POINT0;
- case CH_LAYOUT_5POINT1:
+ case AV_CH_LAYOUT_5POINT1:
return CHANNEL_LAYOUT_5POINT1;
- case CH_LAYOUT_5POINT0_BACK:
+ case AV_CH_LAYOUT_5POINT0_BACK:
return CHANNEL_LAYOUT_5POINT0_BACK;
- case CH_LAYOUT_5POINT1_BACK:
+ case AV_CH_LAYOUT_5POINT1_BACK:
return CHANNEL_LAYOUT_5POINT1_BACK;
- case CH_LAYOUT_7POINT0:
+ case AV_CH_LAYOUT_7POINT0:
return CHANNEL_LAYOUT_7POINT0;
- case CH_LAYOUT_7POINT1:
+ case AV_CH_LAYOUT_7POINT1:
return CHANNEL_LAYOUT_7POINT1;
- case CH_LAYOUT_7POINT1_WIDE:
+ case AV_CH_LAYOUT_7POINT1_WIDE:
return CHANNEL_LAYOUT_7POINT1_WIDE;
- case CH_LAYOUT_STEREO_DOWNMIX:
+ case AV_CH_LAYOUT_STEREO_DOWNMIX:
return CHANNEL_LAYOUT_STEREO_DOWNMIX;
default:
// FFmpeg channel_layout is 0 for .wav and .mp3. We know mono and stereo
@@ -376,7 +376,7 @@ void DestroyAVFormatContext(AVFormatContext* format_context) {
// 1. AVStream is alive.
// 2. AVCodecContext in AVStream is alive.
// 3. AVCodec in AVCodecContext is alive.
- // Notice that closing a codec context without prior avcodec_open() will
+ // Notice that closing a codec context without prior avcodec_open2() will
// result in a crash in FFmpeg.
if (stream && stream->codec && stream->codec->codec) {
stream->discard = AVDISCARD_ALL;
@@ -386,7 +386,7 @@ void DestroyAVFormatContext(AVFormatContext* format_context) {
}
// Then finally cleanup the format context.
- av_close_input_file(format_context);
+ avformat_close_input(&format_context);
}
} // namespace media