| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 << " result: " << result; | 89 << " result: " << result; |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 if ((result = av_seek_frame(format_context_, 0, 0, 0)) < 0) { | 93 if ((result = av_seek_frame(format_context_, 0, 0, 0)) < 0) { |
| 94 DLOG(WARNING) << "AudioFileReader::Open() : could not seek frame -" | 94 DLOG(WARNING) << "AudioFileReader::Open() : could not seek frame -" |
| 95 << " result: " << result; | 95 << " result: " << result; |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 } else { | 98 } else { |
| 99 DLOG(WARNING) << "AudioFileReader::Open() : could not find codec -" | 99 DLOG(WARNING) << "AudioFileReader::Open() : could not find codec -" |
| 100 << " result: " << result; | 100 << " result: " << result; |
| 101 return false; | 101 return false; |
| 102 } | 102 } |
| 103 | 103 |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void AudioFileReader::Close() { | 107 void AudioFileReader::Close() { |
| 108 if (codec_context_ && codec_) | 108 if (codec_context_ && codec_) |
| 109 avcodec_close(codec_context_); | 109 avcodec_close(codec_context_); |
| 110 | 110 |
| 111 codec_context_ = NULL; | 111 codec_context_ = NULL; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 current_frame += frames_read; | 185 current_frame += frames_read; |
| 186 } | 186 } |
| 187 | 187 |
| 188 return true; | 188 return true; |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace media | 191 } // namespace media |
| OLD | NEW |