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

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

Issue 7044092: Not allow compression when requesting multimedia (Closed) Base URL: http://src.chromium.org/svn/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 | « chrome_frame/test/net/fake_external_tab.cc ('k') | 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 }
427 428
428 read_position_ = position; 429 read_position_ = position;
429 return true; 430 return true;
430 } 431 }
431 432
432 bool FFmpegDemuxer::GetSize(int64* size_out) { 433 bool FFmpegDemuxer::GetSize(int64* size_out) {
433 DCHECK(data_source_); 434 DCHECK(data_source_);
434 435
435 return data_source_->GetSize(size_out); 436 return data_source_->GetSize(size_out);
436 } 437 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 read_event_.Wait(); 701 read_event_.Wait();
701 return last_read_bytes_; 702 return last_read_bytes_;
702 } 703 }
703 704
704 void FFmpegDemuxer::SignalReadCompleted(size_t size) { 705 void FFmpegDemuxer::SignalReadCompleted(size_t size) {
705 last_read_bytes_ = size; 706 last_read_bytes_ = size;
706 read_event_.Signal(); 707 read_event_.Signal();
707 } 708 }
708 709
709 } // namespace media 710 } // namespace media
OLDNEW
« no previous file with comments | « chrome_frame/test/net/fake_external_tab.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698