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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 9854031: Replace size_t with int in a few media classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index a31cfacfe082ec5993bf4ddfabda5e62da85a599..6d907d5052c9fa0eddb783052e19eca4491a82dc 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -40,8 +40,8 @@ class AVPacketBuffer : public Buffer {
return reinterpret_cast<const uint8*>(packet_->data);
}
- virtual size_t GetDataSize() const {
- return static_cast<size_t>(packet_->size);
+ virtual int GetDataSize() const {
+ return packet_->size;
}
private:
@@ -389,13 +389,13 @@ size_t FFmpegDemuxer::Read(size_t size, uint8* data) {
return 0;
// Asynchronous read from data source.
- data_source_->Read(read_position_, size, data,
- base::Bind(&FFmpegDemuxer::OnReadCompleted, this));
+ data_source_->Read(read_position_, size, data, base::Bind(
+ &FFmpegDemuxer::SignalReadCompleted, this));
// TODO(hclam): The method is called on the demuxer thread and this method
// call will block the thread. We need to implemented an additional thread to
// let FFmpeg demuxer methods to run on.
- size_t last_read_bytes = WaitForRead();
+ int last_read_bytes = WaitForRead();
if (last_read_bytes == DataSource::kReadError) {
if (host())
host()->OnDemuxerError(PIPELINE_ERROR_READ);
@@ -733,16 +733,12 @@ void FFmpegDemuxer::StreamHasEnded() {
}
}
-void FFmpegDemuxer::OnReadCompleted(size_t size) {
- SignalReadCompleted(size);
-}
-
-size_t FFmpegDemuxer::WaitForRead() {
+int FFmpegDemuxer::WaitForRead() {
read_event_.Wait();
return last_read_bytes_;
}
-void FFmpegDemuxer::SignalReadCompleted(size_t size) {
+void FFmpegDemuxer::SignalReadCompleted(int size) {
last_read_bytes_ = size;
read_event_.Signal();
}
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698