OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/audio_file_reader.h" | 5 #include "media/filters/audio_file_reader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 DCHECK(context); | 67 DCHECK(context); |
68 format_context_ = context; | 68 format_context_ = context; |
69 | 69 |
70 // Get the codec context. | 70 // Get the codec context. |
71 codec_context_ = NULL; | 71 codec_context_ = NULL; |
72 for (size_t i = 0; i < format_context_->nb_streams; ++i) { | 72 for (size_t i = 0; i < format_context_->nb_streams; ++i) { |
73 AVCodecContext* c = format_context_->streams[i]->codec; | 73 AVCodecContext* c = format_context_->streams[i]->codec; |
74 if (c->codec_type == CODEC_TYPE_AUDIO) { | 74 if (c->codec_type == AVMEDIA_TYPE_AUDIO) { |
75 codec_context_ = c; | 75 codec_context_ = c; |
76 break; | 76 break; |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 // Get the codec. | 80 // Get the codec. |
81 if (!codec_context_) | 81 if (!codec_context_) |
82 return false; | 82 return false; |
83 | 83 |
84 av_find_stream_info(format_context_); | 84 av_find_stream_info(format_context_); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 current_frame += frames_read; | 177 current_frame += frames_read; |
178 } | 178 } |
179 | 179 |
180 return true; | 180 return true; |
181 } | 181 } |
182 | 182 |
183 } // namespace media | 183 } // namespace media |
OLD | NEW |