mpegpsdemux: recalculate adjust if difference is negative

One of my dvds jump on some position and miss about 1 minute of stream.
The reason was mpeg timestamps. On some position scr difference is negative.
It produced negative timestamps. Since it was converted to unsigned value,
gstreamer timestamps was invalid. Instead of increasing mpeg ts,
they was decreasing till it started to be positive.

The jump in timestamps caused mpeg2dec to skip frames to make QoS happy.

This patch just make diff unsigned to avoid negative values.

Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>

https://bugzilla.gnome.org/show_bug.cgi?id=656115
This commit is contained in:
Alexey Fisher 2011-11-29 12:20:51 +01:00 committed by Vincent Penquerc'h
parent e98b17a8dc
commit 2099a39459

View file

@ -1607,7 +1607,7 @@ gst_flups_demux_parse_pack_start (GstFluPSDemux * demux)
/* adjustment of the SCR */
if (G_LIKELY (demux->current_scr != G_MAXUINT64)) {
gint64 diff;
guint64 diff;
guint64 old_scr, old_mux_rate, bss, adjust = 0;
/* keep SCR of the previous packet */