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

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

Issue 173449: Merge 24331 - Fix for audio/video not firing ended if you change src and call... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/webkit/glue/webmediaplayer_impl.cc:r24331
OLDNEW
1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 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/glue/webmediaplayer_impl.h" 5 #include "webkit/glue/webmediaplayer_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "media/base/media_format.h" 9 #include "media/base/media_format.h"
10 #include "media/filters/ffmpeg_audio_decoder.h" 10 #include "media/filters/ffmpeg_audio_decoder.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return true; 259 return true;
260 } 260 }
261 261
262 void WebMediaPlayerImpl::seek(float seconds) { 262 void WebMediaPlayerImpl::seek(float seconds) {
263 DCHECK(MessageLoop::current() == main_loop_); 263 DCHECK(MessageLoop::current() == main_loop_);
264 264
265 // WebKit fires a seek(0) at the very start, however pipeline already does a 265 // WebKit fires a seek(0) at the very start, however pipeline already does a
266 // seek(0) internally. Avoid doing seek(0) the second time because this will 266 // seek(0) internally. Avoid doing seek(0) the second time because this will
267 // cause extra pre-rolling and will break servers without range request 267 // cause extra pre-rolling and will break servers without range request
268 // support. 268 // support.
269 //
270 // We still have to notify WebKit that time has changed otherwise
271 // HTMLMediaElement gets into an inconsistent state.
269 if (pipeline_->GetCurrentTime().ToInternalValue() == 0 && seconds == 0) { 272 if (pipeline_->GetCurrentTime().ToInternalValue() == 0 && seconds == 0) {
273 GetClient()->timeChanged();
270 return; 274 return;
271 } 275 }
272 276
273 // Try to preserve as much accuracy as possible. 277 // Try to preserve as much accuracy as possible.
274 float microseconds = seconds * base::Time::kMicrosecondsPerSecond; 278 float microseconds = seconds * base::Time::kMicrosecondsPerSecond;
275 SetReadyState(WebKit::WebMediaPlayer::HaveMetadata); 279 SetReadyState(WebKit::WebMediaPlayer::HaveMetadata);
276 pipeline_->Seek( 280 pipeline_->Seek(
277 base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)), 281 base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)),
278 NewCallback(proxy_.get(), 282 NewCallback(proxy_.get(),
279 &WebMediaPlayerImpl::Proxy::PipelineSeekCallback)); 283 &WebMediaPlayerImpl::Proxy::PipelineSeekCallback));
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 570 }
567 } 571 }
568 572
569 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { 573 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() {
570 DCHECK(MessageLoop::current() == main_loop_); 574 DCHECK(MessageLoop::current() == main_loop_);
571 DCHECK(client_); 575 DCHECK(client_);
572 return client_; 576 return client_;
573 } 577 }
574 578
575 } // namespace webkit_glue 579 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698