mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-16 04:54:12 +00:00
matroskademux: prefer index of video track to perform seeking
This commit is contained in:
parent
d654eeb6de
commit
6ccffcf5f1
1 changed files with 24 additions and 0 deletions
|
@ -2133,6 +2133,28 @@ gst_matroska_demux_element_send_event (GstElement * element, GstEvent * event)
|
|||
return res;
|
||||
}
|
||||
|
||||
/* determine track to seek in */
|
||||
static GstMatroskaTrackContext *
|
||||
gst_matroska_demux_get_seek_track (GstMatroskaDemux * demux,
|
||||
GstMatroskaTrackContext * track)
|
||||
{
|
||||
gint i;
|
||||
|
||||
if (track && track->type == GST_MATROSKA_TRACK_TYPE_VIDEO)
|
||||
return track;
|
||||
|
||||
/* FIXME thread safety */
|
||||
for (i = 0; i < demux->src->len; i++) {
|
||||
GstMatroskaTrackContext *stream;
|
||||
|
||||
stream = g_ptr_array_index (demux->src, i);
|
||||
if (stream->type == GST_MATROSKA_TRACK_TYPE_VIDEO && stream->index_table)
|
||||
track = stream;
|
||||
}
|
||||
|
||||
return track;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
|
||||
GstPad * pad, GstEvent * event)
|
||||
|
@ -2152,6 +2174,8 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
|
|||
if (pad)
|
||||
track = gst_pad_get_element_private (pad);
|
||||
|
||||
track = gst_matroska_demux_get_seek_track (demux, track);
|
||||
|
||||
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
|
||||
&stop_type, &stop);
|
||||
|
||||
|
|
Loading…
Reference in a new issue