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 "content/renderer/media/webmediaplayer_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 | 395 |
396 // Kick off the asynchronous seek! | 396 // Kick off the asynchronous seek! |
397 pipeline_.Seek( | 397 pipeline_.Seek( |
398 seek_time, | 398 seek_time, |
399 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek)); | 399 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek)); |
400 } | 400 } |
401 | 401 |
402 void WebMediaPlayerImpl::setRate(double rate) { | 402 void WebMediaPlayerImpl::setRate(double rate) { |
403 DCHECK(main_loop_->BelongsToCurrentThread()); | 403 DCHECK(main_loop_->BelongsToCurrentThread()); |
404 | 404 |
405 if (rate == playback_rate_) | |
acolwell GONE FROM CHROMIUM
2014/06/02 22:37:02
Do we really need this? Shouldn't the caller in Bl
| |
406 return; | |
407 | |
405 // TODO(kylep): Remove when support for negatives is added. Also, modify the | 408 // TODO(kylep): Remove when support for negatives is added. Also, modify the |
406 // following checks so rewind uses reasonable values also. | 409 // following checks so rewind uses reasonable values also. |
407 if (rate < 0.0) | 410 if (rate < 0.0) |
408 return; | 411 return; |
409 | 412 |
410 // Limit rates to reasonable values by clamping. | 413 // Limit rates to reasonable values by clamping. |
411 if (rate != 0.0) { | 414 if (rate != 0.0) { |
412 if (rate < kMinRate) | 415 if (rate < kMinRate) |
413 rate = kMinRate; | 416 rate = kMinRate; |
414 else if (rate > kMaxRate) | 417 else if (rate > kMaxRate) |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1375 compositor_task_runner_->PostTask(FROM_HERE, | 1378 compositor_task_runner_->PostTask(FROM_HERE, |
1376 base::Bind(&GetCurrentFrameAndSignal, | 1379 base::Bind(&GetCurrentFrameAndSignal, |
1377 base::Unretained(compositor_), | 1380 base::Unretained(compositor_), |
1378 &video_frame, | 1381 &video_frame, |
1379 &event)); | 1382 &event)); |
1380 event.Wait(); | 1383 event.Wait(); |
1381 return video_frame; | 1384 return video_frame; |
1382 } | 1385 } |
1383 | 1386 |
1384 } // namespace content | 1387 } // namespace content |
OLD | NEW |