Loading media/libstagefright/VBRISeeker.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,13 @@ sp<VBRISeeker> VBRISeeker::CreateFromSource( sp<VBRISeeker> seeker = new VBRISeeker; seeker->mBasePos = post_id3_pos + frameSize; // only update mDurationUs if the calculated duration is valid (non zero) // otherwise, leave duration at -1 so that getDuration() and getOffsetForTime() // return false when called, to indicate that this vbri tag does not have the // requested information if (durationUs) { seeker->mDurationUs = durationUs; } off64_t offset = post_id3_pos; for (size_t i = 0; i < numEntries; ++i) { Loading media/libstagefright/XINGSeeker.cpp +9 −6 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ XINGSeeker::XINGSeeker() : mDurationUs(-1), mSizeBytes(0), mEncoderDelay(0), mEncoderPadding(0) { mEncoderPadding(0), mTOCValid(false) { } bool XINGSeeker::getDuration(int64_t *durationUs) { Loading Loading @@ -81,10 +82,6 @@ sp<XINGSeeker> XINGSeeker::CreateFromSource( seeker->mFirstFramePos = first_frame_pos; seeker->mSizeBytes = 0; seeker->mTOCValid = false; seeker->mDurationUs = 0; uint8_t buffer[4]; int offset = first_frame_pos; if (source->readAt(offset, &buffer, 4) < 4) { // get header Loading Loading @@ -140,7 +137,13 @@ sp<XINGSeeker> XINGSeeker::CreateFromSource( return NULL; } int32_t frames = U32_AT(buffer); // only update mDurationUs if the calculated duration is valid (non zero) // otherwise, leave duration at -1 so that getDuration() and getOffsetForTime() // return false when called, to indicate that this xing tag does not have the // requested information if (frames) { seeker->mDurationUs = (int64_t)frames * samples_per_frame * 1000000LL / sampling_rate; } offset += 4; } if (flags & 0x0002) { // Bytes field is present Loading Loading
media/libstagefright/VBRISeeker.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,13 @@ sp<VBRISeeker> VBRISeeker::CreateFromSource( sp<VBRISeeker> seeker = new VBRISeeker; seeker->mBasePos = post_id3_pos + frameSize; // only update mDurationUs if the calculated duration is valid (non zero) // otherwise, leave duration at -1 so that getDuration() and getOffsetForTime() // return false when called, to indicate that this vbri tag does not have the // requested information if (durationUs) { seeker->mDurationUs = durationUs; } off64_t offset = post_id3_pos; for (size_t i = 0; i < numEntries; ++i) { Loading
media/libstagefright/XINGSeeker.cpp +9 −6 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ XINGSeeker::XINGSeeker() : mDurationUs(-1), mSizeBytes(0), mEncoderDelay(0), mEncoderPadding(0) { mEncoderPadding(0), mTOCValid(false) { } bool XINGSeeker::getDuration(int64_t *durationUs) { Loading Loading @@ -81,10 +82,6 @@ sp<XINGSeeker> XINGSeeker::CreateFromSource( seeker->mFirstFramePos = first_frame_pos; seeker->mSizeBytes = 0; seeker->mTOCValid = false; seeker->mDurationUs = 0; uint8_t buffer[4]; int offset = first_frame_pos; if (source->readAt(offset, &buffer, 4) < 4) { // get header Loading Loading @@ -140,7 +137,13 @@ sp<XINGSeeker> XINGSeeker::CreateFromSource( return NULL; } int32_t frames = U32_AT(buffer); // only update mDurationUs if the calculated duration is valid (non zero) // otherwise, leave duration at -1 so that getDuration() and getOffsetForTime() // return false when called, to indicate that this xing tag does not have the // requested information if (frames) { seeker->mDurationUs = (int64_t)frames * samples_per_frame * 1000000LL / sampling_rate; } offset += 4; } if (flags & 0x0002) { // Bytes field is present Loading