| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/blink/multibuffer_data_source.h" | 5 #include "media/blink/multibuffer_data_source.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // If init_cb is set, we initialization is not finished yet. | 259 // If init_cb is set, we initialization is not finished yet. |
| 260 if (!init_cb_.is_null()) | 260 if (!init_cb_.is_null()) |
| 261 return false; | 261 return false; |
| 262 if (failed_) | 262 if (failed_) |
| 263 return false; | 263 return false; |
| 264 return true; | 264 return true; |
| 265 } | 265 } |
| 266 | 266 |
| 267 void MultibufferDataSource::MediaPlaybackRateChanged(double playback_rate) { | 267 void MultibufferDataSource::MediaPlaybackRateChanged(double playback_rate) { |
| 268 DCHECK(render_task_runner_->BelongsToCurrentThread()); | 268 DCHECK(render_task_runner_->BelongsToCurrentThread()); |
| 269 DCHECK(reader_.get()); | |
| 270 | 269 |
| 271 if (playback_rate < 0.0) | 270 if (playback_rate < 0.0) |
| 272 return; | 271 return; |
| 273 | 272 |
| 274 playback_rate_ = playback_rate; | 273 playback_rate_ = playback_rate; |
| 275 cancel_on_defer_ = false; | 274 cancel_on_defer_ = false; |
| 276 UpdateBufferSizes(); | 275 UpdateBufferSizes(); |
| 277 } | 276 } |
| 278 | 277 |
| 279 void MultibufferDataSource::MediaIsPlaying() { | 278 void MultibufferDataSource::MediaIsPlaying() { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 reader_->SetPinRange(back_buffer, kMaxBufferPreload + kPreloadHighExtra); | 614 reader_->SetPinRange(back_buffer, kMaxBufferPreload + kPreloadHighExtra); |
| 616 | 615 |
| 617 if (preload_ == METADATA) { | 616 if (preload_ == METADATA) { |
| 618 reader_->SetPreload(0, 0); | 617 reader_->SetPreload(0, 0); |
| 619 } else { | 618 } else { |
| 620 reader_->SetPreload(preload_high, preload); | 619 reader_->SetPreload(preload_high, preload); |
| 621 } | 620 } |
| 622 } | 621 } |
| 623 | 622 |
| 624 } // namespace media | 623 } // namespace media |
| OLD | NEW |