May 16, 2013 at 11:00 PM
Edited May 16, 2013 at 11:00 PM
There does seem to be a slight A/V sync problem. Are you sure this isn't happening on other players? VLC seemed to be doing the same thing.
I'm not saying that there isn't a problem with the code, but if there is a fixed offset, then you could try doing something like this to compensate:
Change TsMediaParser.cs (around line 200) from:
_timestampOffsetHandlers.Add(ts => localStreamBuffer.TimestampOffset = ts);
localStreamBuffer.TimestampOffset = ts;
if (streamType.Contents == TsStreamType.StreamContents.Video)
localStreamBuffer.TimestampOffset += TimeSpan.FromMilliseconds(500);
Obviously, 500ms would be too large, but one should hopefully be able to find a constant that works. If you need to move things in the other direction, changing the "TsStreamType.StreamContents.Video" into "TsStreamType.StreamContents.Audio"
should be safer than subtracting an offset.
Also, there are some constants in BufferingManager that are probably too small for this stream. If you change the first two constants into something like this, then there should be less "Buffering":
const int BufferSizeMaximum = 4096 * 1024;
const int BufferSizeStopBuffering = 2048 * 1024;