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

Side by Side Diff: media/base/pipeline.cc

Issue 740663002: Relanding 'Ignore seek operations to the current time in pause state' patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed duration change callback Created 6 years 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
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "media/base/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 627
628 void Pipeline::RunEndedCallbackIfNeeded() { 628 void Pipeline::RunEndedCallbackIfNeeded() {
629 DCHECK(task_runner_->BelongsToCurrentThread()); 629 DCHECK(task_runner_->BelongsToCurrentThread());
630 630
631 if (renderer_ && !renderer_ended_) 631 if (renderer_ && !renderer_ended_)
632 return; 632 return;
633 633
634 if (text_renderer_ && text_renderer_->HasTracks() && !text_renderer_ended_) 634 if (text_renderer_ && text_renderer_->HasTracks() && !text_renderer_ended_)
635 return; 635 return;
636 636
637 // Correct the duration if current time is less
638 TimeDelta media_time = renderer_->GetMediaTime();
639 if (media_time < duration_) {
640 duration_ = media_time;
philipj_slow 2014/11/25 10:01:04 Shouldn't this be SetDuration(media_time), or what
Srirama 2014/11/25 10:19:29 I have done a similar thing in patchset4, but ther
philipj_slow 2014/11/25 12:24:29 By only setting duration_, I guess HTMLMediaElemen
641 }
637 DCHECK_EQ(status_, PIPELINE_OK); 642 DCHECK_EQ(status_, PIPELINE_OK);
638 ended_cb_.Run(); 643 ended_cb_.Run();
639 } 644 }
640 645
641 scoped_ptr<TextRenderer> Pipeline::CreateTextRenderer() { 646 scoped_ptr<TextRenderer> Pipeline::CreateTextRenderer() {
642 DCHECK(task_runner_->BelongsToCurrentThread()); 647 DCHECK(task_runner_->BelongsToCurrentThread());
643 648
644 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 649 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
645 if (!cmd_line->HasSwitch(switches::kEnableInbandTextTracks)) 650 if (!cmd_line->HasSwitch(switches::kEnableInbandTextTracks))
646 return scoped_ptr<media::TextRenderer>(); 651 return scoped_ptr<media::TextRenderer>();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 metadata_cb_.Run(metadata); 718 metadata_cb_.Run(metadata);
714 } 719 }
715 720
716 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { 721 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) {
717 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 722 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
718 DCHECK(task_runner_->BelongsToCurrentThread()); 723 DCHECK(task_runner_->BelongsToCurrentThread());
719 buffering_state_cb_.Run(new_buffering_state); 724 buffering_state_cb_.Run(new_buffering_state);
720 } 725 }
721 726
722 } // namespace media 727 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698