Exemplo n.º 1
0
        private int StartNewSection(byte[] tsPacket, int index, int sectionLen)
        {
            int newstart = -1;
            int len      = -1;

            if (sectionLen > -1)
            {
                if (index + sectionLen < 185)
                {
                    len      = sectionLen + 3;
                    newstart = index + sectionLen + 3;
                }
                else
                {
                    newstart = 188;
                    len      = 188 - index;
                }
            }
            else
            {
                newstart = 188;
                len      = 188 - index;
            }
            m_section.Reset();
            Array.Copy(tsPacket, index, m_section.Data, 0, len);
            m_section.BufferPos = len;
            m_section.DecodeHeader();
            return(newstart);
        }
Exemplo n.º 2
0
        private int AddToSection(byte[] tsPacket, int index, int sectionLen)
        {
            int num    = -1;
            int length = -1;

            if ((index + sectionLen) < 0xb9)
            {
                length = sectionLen + 3;
                num    = (index + sectionLen) + 3;
            }
            else
            {
                num    = 0xbc;
                length = 0xbc - index;
            }
            Array.Copy(tsPacket, index, _section.Data, _section.BufferPos, length);
            _section.BufferPos += length;
            _section.DecodeHeader();
            return(num);
        }