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

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 325503003: Fix seeking when the start time is non-zero. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FFmpeg only start time. Created 6 years, 6 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 "media/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <list> 9 #include <list>
10 10
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 base::AutoLock auto_lock(lock_); 1084 base::AutoLock auto_lock(lock_);
1085 if (type == DemuxerStream::VIDEO) 1085 if (type == DemuxerStream::VIDEO)
1086 return video_.get(); 1086 return video_.get();
1087 1087
1088 if (type == DemuxerStream::AUDIO) 1088 if (type == DemuxerStream::AUDIO)
1089 return audio_.get(); 1089 return audio_.get();
1090 1090
1091 return NULL; 1091 return NULL;
1092 } 1092 }
1093 1093
1094 TimeDelta ChunkDemuxer::GetStartTime() const {
1095 return TimeDelta();
1096 }
1097
1098 base::Time ChunkDemuxer::GetTimelineOffset() const { 1094 base::Time ChunkDemuxer::GetTimelineOffset() const {
1099 return timeline_offset_; 1095 return timeline_offset_;
1100 } 1096 }
1101 1097
1102 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { 1098 Demuxer::Liveness ChunkDemuxer::GetLiveness() const {
1103 return liveness_; 1099 return liveness_;
1104 } 1100 }
1105 1101
1106 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { 1102 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) {
1107 DVLOG(1) << "StartWaitingForSeek()"; 1103 DVLOG(1) << "StartWaitingForSeek()";
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 1585
1590 liveness_ = params.liveness; 1586 liveness_ = params.liveness;
1591 } 1587 }
1592 1588
1593 // Wait until all streams have initialized. 1589 // Wait until all streams have initialized.
1594 if ((!source_id_audio_.empty() && !audio_) || 1590 if ((!source_id_audio_.empty() && !audio_) ||
1595 (!source_id_video_.empty() && !video_)) { 1591 (!source_id_video_.empty() && !video_)) {
1596 return; 1592 return;
1597 } 1593 }
1598 1594
1599 SeekAllSources(GetStartTime()); 1595 SeekAllSources(base::TimeDelta());
1600 StartReturningData(); 1596 StartReturningData();
1601 1597
1602 if (duration_ == kNoTimestamp()) 1598 if (duration_ == kNoTimestamp())
1603 duration_ = kInfiniteDuration(); 1599 duration_ = kInfiniteDuration();
1604 1600
1605 // The demuxer is now initialized after the |start_timestamp_| was set. 1601 // The demuxer is now initialized after the |start_timestamp_| was set.
1606 ChangeState_Locked(INITIALIZED); 1602 ChangeState_Locked(INITIALIZED);
1607 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); 1603 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK);
1608 } 1604 }
1609 1605
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 } 1740 }
1745 1741
1746 void ChunkDemuxer::ShutdownAllStreams() { 1742 void ChunkDemuxer::ShutdownAllStreams() {
1747 for (SourceStateMap::iterator itr = source_state_map_.begin(); 1743 for (SourceStateMap::iterator itr = source_state_map_.begin();
1748 itr != source_state_map_.end(); ++itr) { 1744 itr != source_state_map_.end(); ++itr) {
1749 itr->second->Shutdown(); 1745 itr->second->Shutdown();
1750 } 1746 }
1751 } 1747 }
1752 1748
1753 } // namespace media 1749 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698