From 0b5c3e7107e0a742aa0794de46988f108d21427f Mon Sep 17 00:00:00 2001 From: JW Wang Date: Thu, 9 Feb 2017 13:39:56 +0800 Subject: [PATCH] Bug 1338023. Part 6 - remove unused code and fix comments. r=gerald MozReview-Commit-ID: 7WCFnraD313 --HG-- extra : rebase_source : 78cb30bc565a5051b7067589845bfd1b42fab220 extra : intermediate-source : 10b41917a6c62b60a0e428a0adf17684b39c8542 extra : source : 0388389e6fb45e077b9c64c7f2c36042e75b0d47 --- dom/media/ogg/OggCodecState.cpp | 8 -------- dom/media/ogg/OggCodecState.h | 24 ++---------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/dom/media/ogg/OggCodecState.cpp b/dom/media/ogg/OggCodecState.cpp index e7253d860c74..e748448b8613 100644 --- a/dom/media/ogg/OggCodecState.cpp +++ b/dom/media/ogg/OggCodecState.cpp @@ -198,14 +198,6 @@ Clone(ogg_packet* aPacket) return OggPacketPtr(p); } -void -OggCodecState::ReleasePacket(ogg_packet* aPacket) -{ - if (aPacket) { - OggPacketDeletePolicy()(aPacket); - } -} - void OggPacketQueue::Append(OggPacketPtr aPacket) { diff --git a/dom/media/ogg/OggCodecState.h b/dom/media/ogg/OggCodecState.h index d95753eed268..1a45ffc1079d 100644 --- a/dom/media/ogg/OggCodecState.h +++ b/dom/media/ogg/OggCodecState.h @@ -10,8 +10,6 @@ // For MOZ_SAMPLE_TYPE_* #include "FlacFrameParser.h" #include "VideoUtils.h" -#include -#include #include #include #include @@ -200,9 +198,8 @@ public: // Returns the next raw packet in the stream, or nullptr if there are no more // packets buffered in the packet queue. More packets can be buffered by - // inserting one or more pages into the stream by calling PageIn(). The - // caller is responsible for deleting returned packet's using - // OggCodecState::ReleasePacket(). The packet will have a valid granulepos. + // inserting one or more pages into the stream by calling PageIn(). + // The packet will have a valid granulepos. OggPacketPtr PacketOut(); // Returns the next raw packet in the stream, or nullptr if there are no more @@ -213,10 +210,6 @@ public: // Moves all raw packets from aOther to the front of the current packet queue. void PushFront(OggPacketQueue&& aOther); - // Releases the memory used by a cloned packet. Every packet returned by - // PacketOut() must be free'd using this function. - static void ReleasePacket(ogg_packet* aPacket); - // Returns the next packet in the stream as a MediaRawData, or nullptr // if there are no more packets buffered in the packet queue. More packets // can be buffered by inserting one or more pages into the stream by calling @@ -665,17 +658,4 @@ private: } // namespace mozilla -// This allows the use of nsAutoRefs for an ogg_packet that properly free the -// contents of the packet. -template <> -class nsAutoRefTraits : public nsPointerRefTraits -{ -public: - static void Release(ogg_packet* aPacket) - { - mozilla::OggCodecState::ReleasePacket(aPacket); - } -}; - - #endif