зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338023. Part 1 - add OggPacketDeletePolicy. r=gerald
MozReview-Commit-ID: KhuMed88j4V --HG-- extra : rebase_source : e06d6bdb5efc87fb570282e6526c39825ea8821c extra : intermediate-source : c1acded5a6e942c4b4daba3dac3074ab554f9dbf extra : source : c90ca181c02d1f69c12b1e1f08d7501c28df3937
This commit is contained in:
Родитель
0a462392c1
Коммит
ce84ae38fd
|
@ -205,9 +205,8 @@ void
|
|||
OggCodecState::ReleasePacket(ogg_packet* aPacket)
|
||||
{
|
||||
if (aPacket) {
|
||||
delete [] aPacket->packet;
|
||||
OggPacketDeletePolicy()(aPacket);
|
||||
}
|
||||
delete aPacket;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -36,14 +36,21 @@ namespace mozilla {
|
|||
|
||||
class OpusParser;
|
||||
|
||||
struct OggPacketDeletePolicy
|
||||
{
|
||||
void operator()(ogg_packet* aPacket) const
|
||||
{
|
||||
delete [] aPacket->packet;
|
||||
delete aPacket;
|
||||
}
|
||||
};
|
||||
|
||||
// Deallocates a packet, used in OggPacketQueue below.
|
||||
class OggPacketDeallocator : public nsDequeFunctor
|
||||
{
|
||||
virtual void* operator() (void* aPacket)
|
||||
virtual void* operator()(void* aPacket)
|
||||
{
|
||||
ogg_packet* p = static_cast<ogg_packet*>(aPacket);
|
||||
delete [] p->packet;
|
||||
delete p;
|
||||
OggPacketDeletePolicy()(static_cast<ogg_packet*>(aPacket));
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче