summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-06-21 12:57:20 -0700
committerGlenn Kasten <gkasten@google.com>2012-07-09 17:06:27 -0700
commit6648821933dc06c0b09ab2c8b32135edddcd4291 (patch)
tree7f39b4c3e3fdb1376a6cb3d0f8007bc3eaaf2fda /services
parent94479fd5405642c67efd14cebe722feb9cbe6e77 (diff)
downloadframeworks_av-6648821933dc06c0b09ab2c8b32135edddcd4291.zip
frameworks_av-6648821933dc06c0b09ab2c8b32135edddcd4291.tar.gz
frameworks_av-6648821933dc06c0b09ab2c8b32135edddcd4291.tar.bz2
AudioFlinger::getBuffer() always returns non-NULL
Change-Id: I543d3db507597cacbfdad5d9ea71732137fe54fb
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp4
-rw-r--r--services/audioflinger/AudioFlinger.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ceaf27d..59c7f84 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -4462,8 +4462,6 @@ status_t AudioFlinger::PlaybackThread::Track::getNextBuffer(
}
buffer->raw = getBuffer(s, framesReq);
- if (buffer->raw == NULL) goto getNextBuffer_exit;
-
buffer->frameCount = framesReq;
return NO_ERROR;
}
@@ -5355,8 +5353,6 @@ status_t AudioFlinger::RecordThread::RecordTrack::getNextBuffer(AudioBufferProvi
}
buffer->raw = getBuffer(s, framesReq);
- if (buffer->raw == NULL) goto getNextBuffer_exit;
-
buffer->frameCount = framesReq;
return NO_ERROR;
}
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index b8bb69e..56d5a15 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -417,6 +417,13 @@ private:
int sampleRate() const; // FIXME inline after cblk sr moved
+ // Return a pointer to the start of a contiguous slice of the track buffer.
+ // Parameter 'offset' is the requested start position, expressed in
+ // monotonically increasing frame units relative to the track epoch.
+ // Parameter 'frames' is the requested length, also in frame units.
+ // Always returns non-NULL. It is the caller's responsibility to
+ // verify that this will be successful; the result of calling this
+ // function with invalid 'offset' or 'frames' is undefined.
void* getBuffer(uint32_t offset, uint32_t frames) const;
bool isStopped() const {