[MPlayer-dev-eng] [PATCH] support for transmitter-driven demuxing clock

Nico Sabbi Nicola.Sabbi at poste.it
Fri Feb 22 00:28:53 CET 2008


Hi,
following a heated thread in nut-devel (search "broadcast nut") it became clear
that in broadcast streams like mpeg-ts (and -ps, although rarely used) following the
transmitter's reference clock embedded in mpeg as PCR is needed to guarantee
a minumum buffer fullness in the receiver, otherwise the emptiness of the buffers
leads to frame  freezes and amenities like that (that I've been experiencing for years
playing DVB and network streams).

The small patch attached changes slightly the behaviour of ds_fill_buffer() so as to keep
on demuxing the stream until the reference clock has reached the pts of the next ds_packet.
I should have used the dts, but since 
- pcr < dts <= pts  always applies
- and since the dts can and will be often missing in the PES headers
- and since dts and pts will always be very near
I decided not to use the dts at all.

The new behaviour will only be used when the entry demuxer->reference_clock != MP_NOPTS_VALUE,
that of course applies only to mpeg-ts if the user took care to add the pcr_pid and pmt_pid in the mux,
thus other formats won't even be affected by this change.

A special case to prevent packets to accumulate without being read was added.

With this patch applied I noticed complete playback stability in the long term, something
that was seriously lacking (and complained of by broadcast users) in the past.

If no one objects I'll commit saturday.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcr4.diff
Type: text/x-diff
Size: 3491 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080222/6723098a/attachment.diff>


More information about the MPlayer-dev-eng mailing list