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

Unified Diff: media/filters/audio_file_reader.h

Issue 11137005: Make sure that DecodeAudioFileData() always returns an AudioBus of the exact length of the file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « no previous file | media/filters/audio_file_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_file_reader.h
===================================================================
--- media/filters/audio_file_reader.h (revision 160749)
+++ media/filters/audio_file_reader.h (working copy)
@@ -37,12 +37,19 @@
// |audio_data| must be of the same size as channels().
// The audio data will be decoded as floating-point linear PCM with
// a nominal range of -1.0 -> +1.0.
- // Returns |true| on success.
- bool Read(AudioBus* audio_bus);
+ // Returns the number of sample-frames actually read which will always be
+ // <= audio_bus->frames()
+ // This corresponds to the actual file length.
DaleCurtis 2012/10/13 01:10:35 I'd remove this sentence since it's not correct as
+ int Read(AudioBus* audio_bus);
// These methods can be called once Open() has been called.
int channels() const;
int sample_rate() const;
+
+ // Please note that duration() and number_of_frames() attempt to be accurate,
+ // but are only estimates. For some encoded formats, the actual duration
+ // of the file can only be determined once all the file data has been read.
+ // The Read() method returns the actual number of sample-frames.
base::TimeDelta duration() const;
int64 number_of_frames() const;
« no previous file with comments | « no previous file | media/filters/audio_file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698