Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c337968e authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

Merge "SoundPool: Fix clang-tidy"

parents 11e32482 a5daa171
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -99,8 +99,8 @@ static status_t decode(int fd, int64_t offset, int64_t length,
                                    __func__);
                            break;
                        }
                        int sampleSize = AMediaExtractor_readSampleData(ex.get(), buf, bufsize);
                        ALOGV("%s: read %d", __func__, sampleSize);
                        ssize_t sampleSize = AMediaExtractor_readSampleData(ex.get(), buf, bufsize);
                        ALOGV("%s: read %zd", __func__, sampleSize);
                        if (sampleSize < 0) {
                            sampleSize = 0;
                            sawInputEOS = true;
@@ -124,8 +124,8 @@ static status_t decode(int fd, int64_t offset, int64_t length,
                }

                AMediaCodecBufferInfo info;
                const int status = AMediaCodec_dequeueOutputBuffer(codec.get(), &info, 1);
                ALOGV("%s: dequeueoutput returned: %d", __func__, status);
                const ssize_t status = AMediaCodec_dequeueOutputBuffer(codec.get(), &info, 1);
                ALOGV("%s: dequeueoutput returned: %zd", __func__, status);
                if (status >= 0) {
                    if (info.flags & AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM) {
                        ALOGV("%s: output EOS", __func__);
@@ -167,10 +167,10 @@ static status_t decode(int fd, int64_t offset, int64_t length,
                } else if (status == AMEDIACODEC_INFO_TRY_AGAIN_LATER) {
                    ALOGV("%s: no output buffer right now", __func__);
                } else if (status <= AMEDIA_ERROR_BASE) {
                    ALOGE("%s: decode error: %d", __func__, status);
                    ALOGE("%s: decode error: %zd", __func__, status);
                    break;
                } else {
                    ALOGV("%s: unexpected info code: %d", __func__, status);
                    ALOGV("%s: unexpected info code: %zd", __func__, status);
                }
            }

+3 −1
Original line number Diff line number Diff line
@@ -317,7 +317,8 @@ void Stream::play_l(const std::shared_ptr<Sound>& sound, int32_t nextStreamID,
            // audio track while the new one is being started and avoids processing them with
            // wrong audio audio buffer size  (mAudioBufferSize)
            auto toggle = mToggle ^ 1;
            void* userData = (void*)((uintptr_t)this | toggle);
            // NOLINTNEXTLINE(performance-no-int-to-ptr)
            void* userData = reinterpret_cast<void*>((uintptr_t)this | toggle);
            audio_channel_mask_t soundChannelMask = sound->getChannelMask();
            // When sound contains a valid channel mask, use it as is.
            // Otherwise, use stream count to calculate channel mask.
@@ -386,6 +387,7 @@ exit:
void Stream::staticCallback(int event, void* user, void* info)
{
    const auto userAsInt = (uintptr_t)user;
    // NOLINTNEXTLINE(performance-no-int-to-ptr)
    auto stream = reinterpret_cast<Stream*>(userAsInt & ~1);
    stream->callback(event, info, int(userAsInt & 1), 0 /* tries */);
}
+1 −1
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ ssize_t StreamManager::removeFromQueues_l(

    // streams on mProcessingStreams are undergoing processing by the StreamManager thread
    // and do not participate in normal stream migration.
    return found;
    return (ssize_t)found;
}

void StreamManager::addToRestartQueue_l(Stream *stream) {
+2 −1
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ static struct fields_t {
    jclass      mSoundPoolClass;
} fields;
static inline SoundPool* MusterSoundPool(JNIEnv *env, jobject thiz) {
    return (SoundPool*)env->GetLongField(thiz, fields.mNativeContext);
    // NOLINTNEXTLINE(performance-no-int-to-ptr)
    return reinterpret_cast<SoundPool*>(env->GetLongField(thiz, fields.mNativeContext));
}
static const char* const kAudioAttributesClassPathName = "android/media/AudioAttributes";
struct audio_attributes_fields_t {