Loading dom/media/gtest/TestOggWriter.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ TEST(TestOggWriter, MultiPageInput) } size_t inputBytes = 0; const size_t USECS_PER_MS = 1000; auto frameData = MakeRefPtr<EncodedFrame::FrameData>(); frameData->SetLength(320); // 320B per 20ms == 128kbps PodZero(frameData->Elements(), frameData->Length()); Loading dom/media/ogg/OggDemuxer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ static const uint32_t OGG_SEEK_FUZZ_USECS = 500000; // The number of microseconds of "pre-roll" we use for Opus streams. // The specification recommends 80 ms. static const int64_t OGG_SEEK_OPUS_PREROLL = 80 * USECS_PER_MS; static const TimeUnit OGG_SEEK_OPUS_PREROLL = TimeUnit::FromMicroseconds(80000); static Atomic<uint32_t> sStreamSourceID(0u); Loading Loading @@ -1095,7 +1095,7 @@ nsresult OggDemuxer::SeekInternal(TrackInfo::TrackType aType, int64_t startTime = StartTime(aType); int64_t endTime = mInfo.mMetadataDuration->ToMicroseconds() + startTime; if (aType == TrackInfo::kAudioTrack && mOpusState) { adjustedTarget = std::max(startTime, target - OGG_SEEK_OPUS_PREROLL); adjustedTarget = std::max(startTime, target - OGG_SEEK_OPUS_PREROLL.ToMicroseconds()); } if (!HaveStartTime(aType) || adjustedTarget == startTime) { Loading Loading @@ -1869,7 +1869,7 @@ nsresult OggDemuxer::SeekInUnbuffered(TrackInfo::TrackType aType, } // Add in the Opus pre-roll if necessary, as well. if (aType == TrackInfo::kAudioTrack && mOpusState) { keyframeOffsetMs = std::max(keyframeOffsetMs, OGG_SEEK_OPUS_PREROLL); keyframeOffsetMs = std::max(keyframeOffsetMs, OGG_SEEK_OPUS_PREROLL.ToMilliseconds()); } int64_t seekTarget = std::max(aStartTime, aTarget - keyframeOffsetMs); // Minimize the bisection search space using the known timestamps from the Loading image/decoders/nsAVIFDecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ nsAVIFDecoder::DecodeResult AVIFParser::GetImage(AVIFImage& aImage) { aImage.mFrameNum = mFrameNum++; int64_t durationMs = aImage.mColorImage->mDuration.ToMicroseconds() / USECS_PER_MS; aImage.mColorImage->mDuration.ToMilliseconds(); aImage.mDuration = FrameTimeout::FromRawMilliseconds( static_cast<int32_t>(std::min<int64_t>(durationMs, INT32_MAX))); Loading Loading
dom/media/gtest/TestOggWriter.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ TEST(TestOggWriter, MultiPageInput) } size_t inputBytes = 0; const size_t USECS_PER_MS = 1000; auto frameData = MakeRefPtr<EncodedFrame::FrameData>(); frameData->SetLength(320); // 320B per 20ms == 128kbps PodZero(frameData->Elements(), frameData->Length()); Loading
dom/media/ogg/OggDemuxer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ static const uint32_t OGG_SEEK_FUZZ_USECS = 500000; // The number of microseconds of "pre-roll" we use for Opus streams. // The specification recommends 80 ms. static const int64_t OGG_SEEK_OPUS_PREROLL = 80 * USECS_PER_MS; static const TimeUnit OGG_SEEK_OPUS_PREROLL = TimeUnit::FromMicroseconds(80000); static Atomic<uint32_t> sStreamSourceID(0u); Loading Loading @@ -1095,7 +1095,7 @@ nsresult OggDemuxer::SeekInternal(TrackInfo::TrackType aType, int64_t startTime = StartTime(aType); int64_t endTime = mInfo.mMetadataDuration->ToMicroseconds() + startTime; if (aType == TrackInfo::kAudioTrack && mOpusState) { adjustedTarget = std::max(startTime, target - OGG_SEEK_OPUS_PREROLL); adjustedTarget = std::max(startTime, target - OGG_SEEK_OPUS_PREROLL.ToMicroseconds()); } if (!HaveStartTime(aType) || adjustedTarget == startTime) { Loading Loading @@ -1869,7 +1869,7 @@ nsresult OggDemuxer::SeekInUnbuffered(TrackInfo::TrackType aType, } // Add in the Opus pre-roll if necessary, as well. if (aType == TrackInfo::kAudioTrack && mOpusState) { keyframeOffsetMs = std::max(keyframeOffsetMs, OGG_SEEK_OPUS_PREROLL); keyframeOffsetMs = std::max(keyframeOffsetMs, OGG_SEEK_OPUS_PREROLL.ToMilliseconds()); } int64_t seekTarget = std::max(aStartTime, aTarget - keyframeOffsetMs); // Minimize the bisection search space using the known timestamps from the Loading
image/decoders/nsAVIFDecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ nsAVIFDecoder::DecodeResult AVIFParser::GetImage(AVIFImage& aImage) { aImage.mFrameNum = mFrameNum++; int64_t durationMs = aImage.mColorImage->mDuration.ToMicroseconds() / USECS_PER_MS; aImage.mColorImage->mDuration.ToMilliseconds(); aImage.mDuration = FrameTimeout::FromRawMilliseconds( static_cast<int32_t>(std::min<int64_t>(durationMs, INT32_MAX))); Loading