protected override void ParseSection(TsPacket packet, int offset, int length)
        {
            if (length < 5)
            {
                return;
            }
            int num1 = offset;

            byte[] buffer = packet.Buffer;
            int    num2   = num1 + length;
            int    num3   = num1 + 2;

            byte[] numArray1 = buffer;
            int    index1    = num3;
            int    num4      = 1;
            int    num5      = index1 + num4;
            byte   num6      = numArray1[index1];
            int    num7      = (int)num6 & 1;
            byte   num8      = (byte)((int)num6 >> 1 & 31);

            byte[] numArray2 = buffer;
            int    index2    = num5;
            int    num9      = 1;
            int    num10     = index2 + num9;
            byte   num11     = numArray2[index2];

            byte[] numArray3 = buffer;
            int    index3    = num10;
            int    num12     = 1;
            int    offset1   = index3 + num12;
            byte   num13     = numArray3[index3];

            TsDescriptors.Parse(this._descriptorFactory, buffer, offset1, num2 - offset1);
        }
예제 #2
0
        protected override void ParseSection(TsPacket packet, int offset, int length)
        {
            if (length < 9)
            {
                return;
            }
            int index1 = offset;

            byte[] buffer = packet.Buffer;
            int    num1   = (int)buffer[index1] << 8 | (int)buffer[index1 + 1];
            int    num2   = index1 + 2;

            byte[] numArray1 = buffer;
            int    index2    = num2;
            int    num3      = 1;
            int    num4      = index2 + num3;
            byte   num5      = numArray1[index2];
            bool   flag      = 0 != ((int)num5 & 1);
            byte   num6      = (byte)((uint)(byte)((uint)num5 >> 1) & 31U);

            byte[] numArray2 = buffer;
            int    index3    = num4;
            int    num7      = 1;
            int    num8      = index3 + num7;
            byte   num9      = numArray2[index3];

            byte[] numArray3 = buffer;
            int    index4    = num8;
            int    num10     = 1;
            int    index5    = index4 + num10;
            byte   num11     = numArray3[index4];

            if ((int)num11 < (int)num9)
            {
                return;
            }
            uint num12  = (uint)buffer[index5] << 8 | (uint)buffer[index5 + 1];
            int  index6 = index5 + 2;

            this._pcrPid = num12 & 8191U;
            int num13   = (int)buffer[index6] << 8 | (int)buffer[index6 + 1];
            int offset1 = index6 + 2;
            int length1 = num13 & 4095;

            if (offset1 - offset + length1 >= length)
            {
                return;
            }
            TsDescriptor[] tsDescriptorArray1 = (TsDescriptor[])null;
            if (length1 > 0)
            {
                tsDescriptorArray1 = Enumerable.ToArray <TsDescriptor>(TsDescriptors.Parse(this._descriptorFactory, buffer, offset1, length1));
            }
            this._newProgramDescriptors = tsDescriptorArray1;
            int num14 = offset1 + length1;
            int num15 = offset + length;

            while (num14 + 5 <= num15)
            {
                byte[] numArray4   = buffer;
                int    index7      = num14;
                int    num16       = 1;
                int    index8      = index7 + num16;
                byte   streamType1 = numArray4[index7];
                uint   num17       = (uint)buffer[index8] << 8 | (uint)buffer[index8 + 1];
                int    index9      = index8 + 2;
                uint   index10     = num17 & 8191U;
                int    num18       = (int)buffer[index9] << 8 | (int)buffer[index9 + 1];
                int    offset2     = index9 + 2;
                int    length2     = num18 & 4095;
                if (offset2 + length2 > num15)
                {
                    return;
                }
                TsDescriptor[] tsDescriptorArray2 = (TsDescriptor[])null;
                if (length2 > 0)
                {
                    tsDescriptorArray2 = Enumerable.ToArray <TsDescriptor>(TsDescriptors.Parse(this._descriptorFactory, buffer, offset2, length2));
                }
                num14 = offset2 + length2;
                TsStreamType streamType2 = TsStreamType.FindStreamType(streamType1);
                TsProgramMapTable.ProgramMap programMap = new TsProgramMapTable.ProgramMap()
                {
                    Pid               = index10,
                    StreamType        = streamType2,
                    StreamDescriptors = tsDescriptorArray2
                };
                this._newProgramStreams[index10] = programMap;
            }
            if ((int)num9 != (int)num11)
            {
                return;
            }
            this.MapProgramStreams();
        }