mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Bug 1900191 - Use nestegg advertised default duration if it exists.
This commit is contained in:
parent
8cb68d8ea8
commit
ea2268b5e8
3 changed files with 19 additions and 5 deletions
|
|
@ -602,9 +602,10 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, MediaRawDataQueue *aSampl
|
|||
}
|
||||
int64_t tstamp = holder->Timestamp();
|
||||
int64_t duration = holder->Duration();
|
||||
int64_t defaultDuration = holder->DefaultDuration();
|
||||
if (aType == TrackInfo::TrackType::kVideoTrack) {
|
||||
WEBM_DEBUG("GetNextPacket(video): tstamp=%" PRId64 ", duration=%" PRId64,
|
||||
tstamp, duration);
|
||||
WEBM_DEBUG("GetNextPacket(video): tstamp=%" PRId64 ", duration=%" PRId64, ", defaultDuration=%" PRId64,
|
||||
tstamp, duration, defaultDuration);
|
||||
}
|
||||
|
||||
// The end time of this frame is the start time of the next frame. Fetch
|
||||
|
|
@ -646,6 +647,8 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, MediaRawDataQueue *aSampl
|
|||
(mIsMediaSource && mLastVideoFrameTime.isSome())) {
|
||||
next_tstamp = tstamp;
|
||||
next_tstamp += tstamp - mLastVideoFrameTime.refOr(0);
|
||||
} else if (defaultDuration >= 0) {
|
||||
next_tstamp = tstamp + defaultDuration;
|
||||
} else if (mVideoFrameEndTimeBeforeReset) {
|
||||
WEBM_DEBUG("Setting next timestamp to be %" PRId64 " us",
|
||||
mVideoFrameEndTimeBeforeReset.value());
|
||||
|
|
@ -883,7 +886,7 @@ WebMDemuxer::DemuxPacket(TrackInfo::TrackType aType,
|
|||
|
||||
int64_t offset = Resource(aType).Tell();
|
||||
RefPtr<NesteggPacketHolder> holder = new NesteggPacketHolder();
|
||||
if (!holder->Init(packet, offset, track, false)) {
|
||||
if (!holder->Init(packet, Context(aType), offset, track, false)) {
|
||||
return NS_ERROR_DOM_MEDIA_DEMUXER_ERR;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue