diff options
author | Glenn Kasten <gkasten@google.com> | 2015-03-20 09:04:21 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2015-03-23 08:02:54 -0700 |
commit | ae4b879d04c4b07c62241a8f507c8dce11e628e4 (patch) | |
tree | dc9dbff427144ad7d6b18f7ba65eb5720a8dadc7 /media/libmedia/AudioTrack.cpp | |
parent | a9757af8a140a1d5ae261c22f9d7eebef99cbe96 (diff) | |
download | frameworks_av-ae4b879d04c4b07c62241a8f507c8dce11e628e4.zip frameworks_av-ae4b879d04c4b07c62241a8f507c8dce11e628e4.tar.gz frameworks_av-ae4b879d04c4b07c62241a8f507c8dce11e628e4.tar.bz2 |
Declare and initialize in one statement
Change-Id: Ie8593692907e67558f9d7654c9a4bf8cbce99bd8
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index c775e7b..9d0a5bc 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1415,8 +1415,7 @@ ssize_t AudioTrack::write(const void* buffer, size_t userSize, bool blocking) return ssize_t(err); } - size_t toWrite; - toWrite = audioBuffer.size; + size_t toWrite = audioBuffer.size; memcpy(audioBuffer.i8, buffer, toWrite); buffer = ((const char *) buffer) + toWrite; userSize -= toWrite; @@ -1829,7 +1828,6 @@ status_t AudioTrack::restoreTrack_l(const char *from) ALOGW("dead IAudioTrack, %s, creating a new one from %s()", isOffloadedOrDirect_l() ? "Offloaded or Direct" : "PCM", from); ++mSequence; - status_t result; // refresh the audio configuration cache in this process to make sure we get new // output parameters and new IAudioFlinger in createTrack_l() @@ -1851,7 +1849,7 @@ status_t AudioTrack::restoreTrack_l(const char *from) // following member variables: mAudioTrack, mCblkMemory and mCblk. // It will also delete the strong references on previous IAudioTrack and IMemory. // If a new IAudioTrack cannot be created, the previous (dead) instance will be left intact. - result = createTrack_l(); + status_t result = createTrack_l(); // take the frames that will be lost by track recreation into account in saved position // For streaming tracks, this is the amount we obtained from the user/client |