Пример #1
0
            public void ReleaseAllAndPool(GATPlayer parentPlayer)
            {
                while (head.next != null)
                {
                    parentPlayer.PoolBufferedSample(head.next);

                    head.next = head.next.next;
                }

                Clear();
            }
Пример #2
0
            public void TrimAndReleaseDiscarded()
            {
                BufferedSample sample = null;
                BufferedSample discardedSample;

                while (head.next != null && head.next.shouldBeRemoved)
                {
                    discardedSample = head.next;
                    head.next       = discardedSample.next;
                    _parentPlayer.PoolBufferedSample(discardedSample);
                }

                if (head.next != null)
                {
                    sample = head.next;

                    while (sample.next != null)
                    {
                        if (sample.next.shouldBeRemoved)
                        {
                            discardedSample = sample.next;
                            sample.next     = discardedSample.next;
                            _parentPlayer.PoolBufferedSample(discardedSample);
                        }
                        else
                        {
                            sample = sample.next;
                        }
                    }
                }

                if (head.next == null)
                {
                    last = null;
                }
                else
                {
                    last = sample;
                }
            }