public void Parse(IMpeg2SystemReader reader, IAttributeState resultState) { _timeStampAttribute.Parse(reader, resultState); if (_useSystemClockReferenceValidation) { ulong systemClockReference = reader.State.LastTimestamp + 1; if (!IsContinuousStream(reader.State, systemClockReference)) { resultState.Invalidate(); return; } reader.State.LastSystemClockReference = systemClockReference; } }
public void Parse <TReader>(IAttributeParser <TReader> parser, TReader reader) where TReader : IReader { IResultAttributeBuilder attributeBuilder = _createAttributeBuilder(); IAttributeState attributeState = _createAttributeState(this, attributeBuilder); IState previousState = _activeState.ChangeState(attributeState); try { parser.Parse(reader, attributeState); } finally { _activeState.ChangeState(previousState); } // TODO: 'Name' must be set on 'attributeBuilder' !! if (!attributeState.Valid) { attributeBuilder.Invalidate(); } _resultBuilder.AddAttribute(attributeBuilder.Build()); }