tsdemux: do not try to compare a PCR with itself for statistics

Especially as one of the logs will cause a divide by zero.

https://bugzilla.gnome.org/show_bug.cgi?id=656927
This commit is contained in:
Vincent Penquerc'h 2011-08-19 17:28:54 +01:00 committed by Sebastian Dröge
parent b19a5ea1f3
commit 66dbdfd4d1

View file

@ -1772,14 +1772,16 @@ beach:
pcroffset->pcr = pcrs[nbpcr - 1];
pcroffset->offset = pcroffs[nbpcr - 1];
}
GST_DEBUG ("pcrdiff:%" GST_TIME_FORMAT " offsetdiff %" G_GUINT64_FORMAT,
GST_TIME_ARGS (PCRTIME_TO_GSTTIME (pcrs[nbpcr - 1] - pcrs[0])),
pcroffs[nbpcr - 1] - pcroffs[0]);
GST_DEBUG ("Estimated bitrate %" G_GUINT64_FORMAT,
gst_util_uint64_scale (GST_SECOND, pcroffs[nbpcr - 1] - pcroffs[0],
PCRTIME_TO_GSTTIME (pcrs[nbpcr - 1] - pcrs[0])));
GST_DEBUG ("Average PCR interval %" G_GUINT64_FORMAT,
(pcroffs[nbpcr - 1] - pcroffs[0]) / nbpcr);
if (nbpcr > 1) {
GST_DEBUG ("pcrdiff:%" GST_TIME_FORMAT " offsetdiff %" G_GUINT64_FORMAT,
GST_TIME_ARGS (PCRTIME_TO_GSTTIME (pcrs[nbpcr - 1] - pcrs[0])),
pcroffs[nbpcr - 1] - pcroffs[0]);
GST_DEBUG ("Estimated bitrate %" G_GUINT64_FORMAT,
gst_util_uint64_scale (GST_SECOND, pcroffs[nbpcr - 1] - pcroffs[0],
PCRTIME_TO_GSTTIME (pcrs[nbpcr - 1] - pcrs[0])));
GST_DEBUG ("Average PCR interval %" G_GUINT64_FORMAT,
(pcroffs[nbpcr - 1] - pcroffs[0]) / nbpcr);
}
}
/* Swallow any errors if it happened during the end scanning */
if (!isinitial)