[MPlayer-dev-eng] [RFC] auto adjustment of playback speed

Uoti Urpala uoti.urpala at pp1.inet.fi
Fri Apr 18 20:11:16 CEST 2008


On Fri, 2008-04-18 at 10:03 +0200, Nico Sabbi wrote:
> This patch implements (quite naively) an auto-adjustment mechanism
> of the playback speed based on the proportion between the real
> delta_time elapsed from the beginning of the playback and the
> delta_reference_clock found in the multiplex.
> At the moment the only mux that carries this information is
> MPEG-TS and only if demuxed by demux_ts.c.
> 
> The patch is just in an initial state, but I'd like to know if this
> code is (or resembles) what Uoti and Rich had in mind when they
> objected to my commit in ds_fill_buffer() a couple of months ago.

This is still fundamentally flawed. You can't match timing with a server
based on just the _contents_ of the stream from the server. Those will
be exactly the same even if the server clock is slower or faster than
yours. Your code would behave exactly the same if the stream came from a
file. Trying to "synchronize clocks with a file" is obviously nonsense.

If for example the demuxer ran in a separate thread and immediately read
all data available from the server then an approach like this could work
(at least in theory, I didn't read the actual code as it was obvious it
could not work overall). But it doesn't; what the demuxer has seen does
not depend on how much data the server has sent but on how much data
MPlayer has wanted to read. The only case where the server speed would
have any effect on the behavior of this code would be if MPlayer is
delayed because the buffer already ran completely empty and a read
blocked.




More information about the MPlayer-dev-eng mailing list