mpegtspacketizer: Don't add existing values to group

If the last value is already identical, there is no need in adding it
yet-another-time
This commit is contained in:
Edward Hervey 2016-11-24 11:11:35 +01:00 committed by Edward Hervey
parent 88dbae3ab9
commit a39dc142e6

View file

@ -1873,6 +1873,11 @@ _set_current_group (MpegTSPCR * pcrtable,
static inline void
_append_group_values (PCROffsetGroup * group, PCROffset pcroffset)
{
/* Only append if new values */
if (group->values[group->last_value].offset == pcroffset.offset &&
group->values[group->last_value].pcr == pcroffset.pcr) {
GST_DEBUG ("Same values, ignoring");
} else {
group->last_value++;
/* Resize values if needed */
if (G_UNLIKELY (group->nb_allocated == group->last_value)) {
@ -1881,6 +1886,7 @@ _append_group_values (PCROffsetGroup * group, PCROffset pcroffset)
g_realloc (group->values, group->nb_allocated * sizeof (PCROffset));
}
group->values[group->last_value] = pcroffset;
}
GST_DEBUG ("First PCR:%" GST_TIME_FORMAT " offset:%" G_GUINT64_FORMAT
" PCR_offset:%" GST_TIME_FORMAT,