mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:46:13 +00:00
qtdemux: do_seek can never be called with a NULL event
This commit is contained in:
parent
83704e32e6
commit
f4f11530c2
1 changed files with 16 additions and 26 deletions
|
@ -1647,24 +1647,19 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event)
|
||||||
GstEvent *flush_event;
|
GstEvent *flush_event;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
if (event) {
|
GST_DEBUG_OBJECT (qtdemux, "doing seek with event");
|
||||||
GST_DEBUG_OBJECT (qtdemux, "doing seek with event");
|
|
||||||
|
|
||||||
gst_event_parse_seek (event, &rate, &format, &flags,
|
gst_event_parse_seek (event, &rate, &format, &flags,
|
||||||
&cur_type, &cur, &stop_type, &stop);
|
&cur_type, &cur, &stop_type, &stop);
|
||||||
seqnum = gst_event_get_seqnum (event);
|
seqnum = gst_event_get_seqnum (event);
|
||||||
|
|
||||||
/* we have to have a format as the segment format. Try to convert
|
/* we have to have a format as the segment format. Try to convert
|
||||||
* if not. */
|
* if not. */
|
||||||
if (!gst_qtdemux_convert_seek (pad, &format, cur_type, &cur,
|
if (!gst_qtdemux_convert_seek (pad, &format, cur_type, &cur,
|
||||||
stop_type, &stop))
|
stop_type, &stop))
|
||||||
goto no_format;
|
goto no_format;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (qtdemux, "seek format %s", gst_format_get_name (format));
|
GST_DEBUG_OBJECT (qtdemux, "seek format %s", gst_format_get_name (format));
|
||||||
} else {
|
|
||||||
GST_DEBUG_OBJECT (qtdemux, "doing seek without event");
|
|
||||||
flags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
flush = flags & GST_SEEK_FLAG_FLUSH;
|
flush = flags & GST_SEEK_FLAG_FLUSH;
|
||||||
|
|
||||||
|
@ -1689,17 +1684,12 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event)
|
||||||
* segment when we close the current segment. */
|
* segment when we close the current segment. */
|
||||||
memcpy (&seeksegment, &qtdemux->segment, sizeof (GstSegment));
|
memcpy (&seeksegment, &qtdemux->segment, sizeof (GstSegment));
|
||||||
|
|
||||||
if (event) {
|
/* configure the segment with the seek variables */
|
||||||
/* configure the segment with the seek variables */
|
GST_DEBUG_OBJECT (qtdemux, "configuring seek");
|
||||||
GST_DEBUG_OBJECT (qtdemux, "configuring seek");
|
if (!gst_segment_do_seek (&seeksegment, rate, format, flags,
|
||||||
if (!gst_segment_do_seek (&seeksegment, rate, format, flags,
|
cur_type, cur, stop_type, stop, &update)) {
|
||||||
cur_type, cur, stop_type, stop, &update)) {
|
ret = FALSE;
|
||||||
ret = FALSE;
|
GST_ERROR_OBJECT (qtdemux, "inconsistent seek values, doing nothing");
|
||||||
GST_ERROR_OBJECT (qtdemux, "inconsistent seek values, doing nothing");
|
|
||||||
} else {
|
|
||||||
/* now do the seek */
|
|
||||||
ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* now do the seek */
|
/* now do the seek */
|
||||||
ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags);
|
ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags);
|
||||||
|
|
Loading…
Reference in a new issue