Refcount NesteggPacketHolder

Also move WebM code away from nsDeque.
This commit is contained in:
trav90
2017-07-09 01:36:40 -05:00
committed by Roy Tam
parent 01d7e75ba8
commit 7b3c4b0039
4 changed files with 49 additions and 73 deletions
+3 -3
View File
@@ -97,7 +97,7 @@ SoftwareWebMVideoDecoder::DecodeVideoFrame(bool &aKeyframeSkip,
// stats counters using the AutoNotifyDecoded stack-based class.
AbstractMediaDecoder::AutoNotifyDecoded a(mReader->GetDecoder());
nsAutoRef<NesteggPacketHolder> holder(mReader->NextPacket(WebMReader::VIDEO));
nsRefPtr<NesteggPacketHolder> holder(mReader->NextPacket(WebMReader::VIDEO));
if (!holder) {
return false;
}
@@ -126,13 +126,13 @@ SoftwareWebMVideoDecoder::DecodeVideoFrame(bool &aKeyframeSkip,
// end of the resource, use the file's duration as the end time of this
// video frame.
uint64_t next_tstamp = 0;
nsAutoRef<NesteggPacketHolder> next_holder(mReader->NextPacket(WebMReader::VIDEO));
nsRefPtr<NesteggPacketHolder> next_holder(mReader->NextPacket(WebMReader::VIDEO));
if (next_holder) {
r = nestegg_packet_tstamp(next_holder->mPacket, &next_tstamp);
if (r == -1) {
return false;
}
mReader->PushVideoPacket(next_holder.disown());
mReader->PushVideoPacket(next_holder.forget());
} else {
next_tstamp = tstamp;
next_tstamp += tstamp - mReader->GetLastVideoFrameTime();