[vlc-devel] [RFC] Don't trust the PCR by default
alexander.adolf at condition-alpha.com
Mon Mar 17 15:23:27 CET 2014
On 2014-03-17, at 04:42 , Francois Cartegnie <fcvlcdev at free.fr> wrote:
> According to the spec, DTS is always monotonically increasing. So we
> might only need to pick the first DTS of the first packet we see,
> assuming there's not violation of that part of the spec.
I would second the statements from the other commenters that running in some sort of error concealment mode by default, does not seem like a compelling idea.
From time to time, there will be cases where the PCR, DTS, or PTS "freaks out" for a short interval. This is probably what Denis discovered. Reasons for this are manyfold, and include packet loss, software glitches, operational changes during play out, etc.
Knowing that these are intermittent effects, and that the timestamps are just fine for the other 99.9% of the time, I would suggest to apply some kind of low-pass filtering approach to conceal the effects of such glitches. I presume this is what Francois is referring to by "observation window"?
If you compute the average and standard deviation of the slope (i.e. first derivative) of each of the three timestamps, then you can get a prediction of what the next timestamp should be (say average plus/minus two times standard deviation), and when you should be receiving it. If it falls outside that window, take it with a grain of salt. ;-) So I think I would suggest to apply error concealment only in cases where you are quite sure there is an error. Typically, and most of the time, TS-es are pretty good and accurate. Your mileage may vary, of course.
Hoping to have helped,
More information about the vlc-devel