/// <summary> /// Parse the descriptor. /// </summary> /// <param name="byteData">The mpeg2 section containing the descriptor.</param> /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param> internal override void Process(byte[] byteData, int index) { lastIndex = index; try { pcrPid = ((byteData[lastIndex] & 0x1f) * 256) + byteData[lastIndex]; lastIndex += 2; int locationCount = byteData[lastIndex]; lastIndex++; if (locationCount != 0) { locations = new Collection <ServiceLocationDescriptorEntry>(); while (locationCount != 0) { ServiceLocationDescriptorEntry location = new ServiceLocationDescriptorEntry(); location.Process(byteData, lastIndex); locations.Add(location); lastIndex = location.Index; locationCount--; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The PSIP Service Location Descriptor message is short")); } }
/// <summary> /// Parse the descriptor. /// </summary> /// <param name="byteData">The mpeg2 section containing the descriptor.</param> /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param> internal override void Process(byte[] byteData, int index) { lastIndex = index; try { pcrPid = ((byteData[lastIndex] & 0x1f) * 256) + byteData[lastIndex]; lastIndex += 2; int locationCount = byteData[lastIndex]; lastIndex++; if (locationCount != 0) { locations = new Collection<ServiceLocationDescriptorEntry>(); while (locationCount != 0) { ServiceLocationDescriptorEntry location = new ServiceLocationDescriptorEntry(); location.Process(byteData, lastIndex); locations.Add(location); lastIndex = location.Index; locationCount--; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The PSIP Service Location Descriptor message is short")); } }