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/filters/ffmpeg_demuxer.cc

Issue 1526303004: Fix buffered range updates in media::Pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android buildfix Created 4 years, 11 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
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/ffmpeg_demuxer_unittest.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/filters/ffmpeg_demuxer.h" 5 #include "media/filters/ffmpeg_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 FFmpegDemuxerStream* audio = GetFFmpegStream(DemuxerStream::AUDIO); 1507 FFmpegDemuxerStream* audio = GetFFmpegStream(DemuxerStream::AUDIO);
1508 FFmpegDemuxerStream* video = GetFFmpegStream(DemuxerStream::VIDEO); 1508 FFmpegDemuxerStream* video = GetFFmpegStream(DemuxerStream::VIDEO);
1509 if (audio && video) { 1509 if (audio && video) {
1510 buffered = audio->GetBufferedRanges().IntersectionWith( 1510 buffered = audio->GetBufferedRanges().IntersectionWith(
1511 video->GetBufferedRanges()); 1511 video->GetBufferedRanges());
1512 } else if (audio) { 1512 } else if (audio) {
1513 buffered = audio->GetBufferedRanges(); 1513 buffered = audio->GetBufferedRanges();
1514 } else if (video) { 1514 } else if (video) {
1515 buffered = video->GetBufferedRanges(); 1515 buffered = video->GetBufferedRanges();
1516 } 1516 }
1517 for (size_t i = 0; i < buffered.size(); ++i) 1517 host_->OnBufferedTimeRangesChanged(buffered);
1518 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i));
1519 } 1518 }
1520 1519
1521 void FFmpegDemuxer::OnDataSourceError() { 1520 void FFmpegDemuxer::OnDataSourceError() {
1522 MEDIA_LOG(ERROR, media_log_) << GetDisplayName() << ": data source error"; 1521 MEDIA_LOG(ERROR, media_log_) << GetDisplayName() << ": data source error";
1523 host_->OnDemuxerError(PIPELINE_ERROR_READ); 1522 host_->OnDemuxerError(PIPELINE_ERROR_READ);
1524 } 1523 }
1525 1524
1526 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { 1525 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) {
1527 DCHECK(task_runner_->BelongsToCurrentThread()); 1526 DCHECK(task_runner_->BelongsToCurrentThread());
1528 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. 1527 for (const auto& stream : streams_) { // |stream| is a ref to a pointer.
1529 if (stream) 1528 if (stream)
1530 stream->SetLiveness(liveness); 1529 stream->SetLiveness(liveness);
1531 } 1530 }
1532 } 1531 }
1533 1532
1534 } // namespace media 1533 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698