summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-19 08:59:58 -0800
committerGlenn Kasten <gkasten@google.com>2012-02-14 09:17:59 -0800
commit99e53b86eebb605b70dd7591b89bf61a9414ed0e (patch)
tree8939550ada02fe21121550a83952ebf7638c0dac /media/libmedia
parent6dbc1359f778575d09d6da722b060a6d72c2e7c5 (diff)
downloadframeworks_av-99e53b86eebb605b70dd7591b89bf61a9414ed0e.zip
frameworks_av-99e53b86eebb605b70dd7591b89bf61a9414ed0e.tar.gz
frameworks_av-99e53b86eebb605b70dd7591b89bf61a9414ed0e.tar.bz2
Update comments
We no longer put the filename at start of file. Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrack.cpp15
-rw-r--r--media/libmedia/IAudioTrack.cpp2
-rw-r--r--media/libmedia/ToneGenerator.cpp2
-rw-r--r--media/libmedia/mediaplayer.cpp2
4 files changed, 10 insertions, 11 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 2518921..db18b36 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -1,4 +1,4 @@
-/* frameworks/base/media/libmedia/AudioTrack.cpp
+/*
**
** Copyright 2007, The Android Open Source Project
**
@@ -792,7 +792,7 @@ status_t AudioTrack::createTrack_l(
}
}
} else {
- // Ensure that buffer alignment matches channelcount
+ // Ensure that buffer alignment matches channelCount
int channelCount = popcount(channelMask);
if (((uint32_t)sharedBuffer->pointer() & (channelCount | 1)) != 0) {
ALOGE("Invalid buffer alignement: address %p, channelCount %d", sharedBuffer->pointer(), channelCount);
@@ -979,7 +979,8 @@ ssize_t AudioTrack::write(const void* buffer, size_t userSize)
if (mSharedBuffer != 0) return INVALID_OPERATION;
if (ssize_t(userSize) < 0) {
- // sanity-check. user is most-likely passing an error code.
+ // Sanity-check: user is most-likely passing an error code, and it would
+ // make the return value ambiguous (actualSize vs error).
ALOGE("AudioTrack::write(buffer=%p, size=%u (%d)",
buffer, userSize, userSize);
return BAD_VALUE;
@@ -1002,8 +1003,6 @@ ssize_t AudioTrack::write(const void* buffer, size_t userSize)
do {
audioBuffer.frameCount = userSize/frameSz;
- // Calling obtainBuffer() with a negative wait count causes
- // an (almost) infinite wait time.
status_t err = obtainBuffer(&audioBuffer, -1);
if (err < 0) {
// out of buffers, return #bytes written
@@ -1093,6 +1092,9 @@ bool AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread)
frames = mRemainingFrames;
}
+ // See description of waitCount parameter at declaration of obtainBuffer().
+ // The logic below prevents us from being stuck below at obtainBuffer()
+ // not being able to handle timed events (position, markers, loops).
int32_t waitCount = -1;
if (mUpdatePeriod || (!mMarkerReached && mMarkerPosition) || mLoopCount) {
waitCount = 1;
@@ -1102,9 +1104,6 @@ bool AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread)
audioBuffer.frameCount = frames;
- // Calling obtainBuffer() with a wait count of 1
- // limits wait time to WAIT_PERIOD_MS. This prevents from being
- // stuck here not being able to handle timed events (position, markers, loops).
status_t err = obtainBuffer(&audioBuffer, waitCount);
if (err < NO_ERROR) {
if (err != TIMED_OUT) {
diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp
index 3724642..a7958de 100644
--- a/media/libmedia/IAudioTrack.cpp
+++ b/media/libmedia/IAudioTrack.cpp
@@ -1,4 +1,4 @@
-/* //device/extlibs/pv/android/IAudioTrack.cpp
+/*
**
** Copyright 2007, The Android Open Source Project
**
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 6cb10aa..54eb98a 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -791,7 +791,7 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1
// generators, instantiates output audio track.
//
// Input:
-// streamType: Type of stream used for tone playback (enum AudioTrack::stream_type)
+// streamType: Type of stream used for tone playback
// volume: volume applied to tone (0.0 to 1.0)
//
// Output:
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index f1c47dd..250425b 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -1,4 +1,4 @@
-/* mediaplayer.cpp
+/*
**
** Copyright 2006, The Android Open Source Project
**