Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: webkit/media/webmediaplayer_impl.cc

Issue 10835044: Cancel pending seek in ChunkDemuxer when a new seek occurs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT + fix threading issue Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/media/webmediaplayer_impl.h" 5 #include "webkit/media/webmediaplayer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 DCHECK_EQ(main_loop_, MessageLoop::current()); 311 DCHECK_EQ(main_loop_, MessageLoop::current());
312 return true; 312 return true;
313 } 313 }
314 314
315 void WebMediaPlayerImpl::seek(float seconds) { 315 void WebMediaPlayerImpl::seek(float seconds) {
316 DCHECK_EQ(main_loop_, MessageLoop::current()); 316 DCHECK_EQ(main_loop_, MessageLoop::current());
317 317
318 if (seeking_) { 318 if (seeking_) {
319 pending_seek_ = true; 319 pending_seek_ = true;
320 pending_seek_seconds_ = seconds; 320 pending_seek_seconds_ = seconds;
321 proxy_->DemuxerCancelPendingSeek();
321 return; 322 return;
322 } 323 }
323 324
324 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); 325 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds));
325 326
326 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); 327 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds);
327 328
328 // Update our paused time. 329 // Update our paused time.
329 if (paused_) 330 if (paused_)
330 paused_time_ = seek_time; 331 paused_time_ = seek_time;
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 return audio_source_provider_; 1031 return audio_source_provider_;
1031 } 1032 }
1032 1033
1033 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 1034 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
1034 DCHECK_EQ(main_loop_, MessageLoop::current()); 1035 DCHECK_EQ(main_loop_, MessageLoop::current());
1035 incremented_externally_allocated_memory_ = true; 1036 incremented_externally_allocated_memory_ = true;
1036 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 1037 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
1037 } 1038 }
1038 1039
1039 } // namespace webkit_media 1040 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698