| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <condition_variable> | 5 #include <condition_variable> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <mutex> | 7 #include <mutex> |
| 8 #include <thread> | 8 #include <thread> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 result_ = Result::kOk; | 228 result_ = Result::kOk; |
| 229 init_complete_.Occur(); | 229 init_complete_.Occur(); |
| 230 | 230 |
| 231 while (true) { | 231 while (true) { |
| 232 bool packet_requested; | 232 bool packet_requested; |
| 233 int64_t seek_position; | 233 int64_t seek_position; |
| 234 SeekCallback seek_callback; | 234 SeekCallback seek_callback; |
| 235 | 235 |
| 236 { | 236 { |
| 237 std::unique_lock<std::mutex> lock(mutex_); | 237 std::unique_lock<std::mutex> lock(mutex_); |
| 238 if (!packet_requested_ && !terminating_ && | 238 while (!packet_requested_ && !terminating_ && |
| 239 seek_position_ == kNotSeeking) { | 239 seek_position_ == kNotSeeking) { |
| 240 condition_variable_.wait(lock); | 240 condition_variable_.wait(lock); |
| 241 } | 241 } |
| 242 | 242 |
| 243 if (terminating_) { | 243 if (terminating_) { |
| 244 return; | 244 return; |
| 245 } | 245 } |
| 246 | 246 |
| 247 packet_requested = packet_requested_; | 247 packet_requested = packet_requested_; |
| 248 packet_requested_ = false; | 248 packet_requested_ = false; |
| 249 | 249 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 return index_; | 340 return index_; |
| 341 } | 341 } |
| 342 | 342 |
| 343 std::unique_ptr<StreamType> FfmpegDemuxImpl::FfmpegDemuxStream::stream_type() | 343 std::unique_ptr<StreamType> FfmpegDemuxImpl::FfmpegDemuxStream::stream_type() |
| 344 const { | 344 const { |
| 345 return SafeClone(stream_type_); | 345 return SafeClone(stream_type_); |
| 346 } | 346 } |
| 347 | 347 |
| 348 } // namespace media | 348 } // namespace media |
| 349 } // namespace mojo | 349 } // namespace mojo |
| OLD | NEW |