mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
matroska: Ref index table when updating track info
Track index table array was being lost during track info update. Ref it over to updated info, so it can be used for finding nearest seek points. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1203>
This commit is contained in:
parent
478f94edc7
commit
41385ab6f7
2 changed files with 10 additions and 2 deletions
|
@ -3512,6 +3512,12 @@ gst_matroska_demux_update_tracks (GstMatroskaDemux * demux, GstEbmlRead * ebml)
|
|||
new_track->pad = old_track->pad;
|
||||
new_track->index = old_track->index;
|
||||
new_track->pos = old_track->pos;
|
||||
|
||||
/* If index table is empty, do not ref it, we will try to fallback
|
||||
* to the generic one from read-common in such case */
|
||||
if (old_track->index_table && old_track->index_table->len > 0)
|
||||
new_track->index_table = g_array_ref (old_track->index_table);
|
||||
|
||||
g_ptr_array_index (demux->common.src, old_track_index) = new_track;
|
||||
gst_pad_set_element_private (new_track->pad, new_track);
|
||||
|
||||
|
|
|
@ -591,10 +591,12 @@ gst_matroska_read_common_do_index_seek (GstMatroskaReadCommon * common,
|
|||
GArray *index;
|
||||
|
||||
/* find entry just before or at the requested position */
|
||||
if (track && track->index_table)
|
||||
if (track && track->index_table) {
|
||||
index = track->index_table;
|
||||
else
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (common->sinkpad, "Missing track index table");
|
||||
index = common->index;
|
||||
}
|
||||
|
||||
if (!index || !index->len)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue