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

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

Issue 7205011: Revert 89532 - Not allow compression when requesting multimedia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
« no previous file with comments | « no previous file | net/url_request/url_request_http_job.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 bool FFmpegDemuxer::GetPosition(int64* position_out) { 415 bool FFmpegDemuxer::GetPosition(int64* position_out) {
416 *position_out = read_position_; 416 *position_out = read_position_;
417 return true; 417 return true;
418 } 418 }
419 419
420 bool FFmpegDemuxer::SetPosition(int64 position) { 420 bool FFmpegDemuxer::SetPosition(int64 position) {
421 DCHECK(data_source_); 421 DCHECK(data_source_);
422 422
423 int64 file_size; 423 int64 file_size;
424 if ((data_source_->GetSize(&file_size) && position >= file_size) || 424 if (!data_source_->GetSize(&file_size) || position >= file_size ||
425 position < 0) { 425 position < 0)
426 return false; 426 return false;
427 }
428 427
429 read_position_ = position; 428 read_position_ = position;
430 return true; 429 return true;
431 } 430 }
432 431
433 bool FFmpegDemuxer::GetSize(int64* size_out) { 432 bool FFmpegDemuxer::GetSize(int64* size_out) {
434 DCHECK(data_source_); 433 DCHECK(data_source_);
435 434
436 return data_source_->GetSize(size_out); 435 return data_source_->GetSize(size_out);
437 } 436 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 read_event_.Wait(); 700 read_event_.Wait();
702 return last_read_bytes_; 701 return last_read_bytes_;
703 } 702 }
704 703
705 void FFmpegDemuxer::SignalReadCompleted(size_t size) { 704 void FFmpegDemuxer::SignalReadCompleted(size_t size) {
706 last_read_bytes_ = size; 705 last_read_bytes_ = size;
707 read_event_.Signal(); 706 read_event_.Signal();
708 } 707 }
709 708
710 } // namespace media 709 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698