mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
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:
parent
88dbae3ab9
commit
a39dc142e6
1 changed files with 13 additions and 7 deletions
|
@ -1873,14 +1873,20 @@ _set_current_group (MpegTSPCR * pcrtable,
|
||||||
static inline void
|
static inline void
|
||||||
_append_group_values (PCROffsetGroup * group, PCROffset pcroffset)
|
_append_group_values (PCROffsetGroup * group, PCROffset pcroffset)
|
||||||
{
|
{
|
||||||
group->last_value++;
|
/* Only append if new values */
|
||||||
/* Resize values if needed */
|
if (group->values[group->last_value].offset == pcroffset.offset &&
|
||||||
if (G_UNLIKELY (group->nb_allocated == group->last_value)) {
|
group->values[group->last_value].pcr == pcroffset.pcr) {
|
||||||
group->nb_allocated += DEFAULT_ALLOCATED_OFFSET;
|
GST_DEBUG ("Same values, ignoring");
|
||||||
group->values =
|
} else {
|
||||||
g_realloc (group->values, group->nb_allocated * sizeof (PCROffset));
|
group->last_value++;
|
||||||
|
/* Resize values if needed */
|
||||||
|
if (G_UNLIKELY (group->nb_allocated == group->last_value)) {
|
||||||
|
group->nb_allocated += DEFAULT_ALLOCATED_OFFSET;
|
||||||
|
group->values =
|
||||||
|
g_realloc (group->values, group->nb_allocated * sizeof (PCROffset));
|
||||||
|
}
|
||||||
|
group->values[group->last_value] = pcroffset;
|
||||||
}
|
}
|
||||||
group->values[group->last_value] = pcroffset;
|
|
||||||
|
|
||||||
GST_DEBUG ("First PCR:%" GST_TIME_FORMAT " offset:%" G_GUINT64_FORMAT
|
GST_DEBUG ("First PCR:%" GST_TIME_FORMAT " offset:%" G_GUINT64_FORMAT
|
||||||
" PCR_offset:%" GST_TIME_FORMAT,
|
" PCR_offset:%" GST_TIME_FORMAT,
|
||||||
|
|
Loading…
Reference in a new issue