mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
matroskademux: filter bogus index entries with missing block number
... to avoid contradictory information resulting in seeks sending more downstream than needed for the corresponding segment.
This commit is contained in:
parent
00ed34d2eb
commit
ebfc77da19
1 changed files with 15 additions and 0 deletions
|
@ -982,6 +982,21 @@ gst_matroska_read_common_parse_index_cuetrack (GstMatroskaReadCommon * common,
|
|||
|
||||
DEBUG_ELEMENT_STOP (common, ebml, "CueTrackPositions", ret);
|
||||
|
||||
/* (e.g.) lavf typically creates entries without a block number,
|
||||
* which is bogus and leads to contradictory information */
|
||||
if (common->index->len) {
|
||||
GstMatroskaIndex *last_idx;
|
||||
|
||||
last_idx = &g_array_index (common->index, GstMatroskaIndex,
|
||||
common->index->len - 1);
|
||||
if (last_idx->block == idx.block && last_idx->pos == idx.pos &&
|
||||
last_idx->track == idx.track && idx.time > last_idx->time) {
|
||||
GST_DEBUG_OBJECT (common, "Cue entry refers to same location, "
|
||||
"but has different time than previous entry; discarding");
|
||||
idx.track = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
|
||||
&& idx.pos != (guint64) - 1 && idx.track > 0) {
|
||||
g_array_append_val (common->index, idx);
|
||||
|
|
Loading…
Reference in a new issue