From f4f11530c2f5070c310e5aadc4c060a7c37e57a8 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Tue, 2 Jul 2019 13:00:32 +0200 Subject: [PATCH] qtdemux: do_seek can never be called with a NULL event --- gst/isomp4/qtdemux.c | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 8ef58ef..79b5f06 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -1647,24 +1647,19 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event) GstEvent *flush_event; 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, - &cur_type, &cur, &stop_type, &stop); - seqnum = gst_event_get_seqnum (event); + gst_event_parse_seek (event, &rate, &format, &flags, + &cur_type, &cur, &stop_type, &stop); + seqnum = gst_event_get_seqnum (event); - /* we have to have a format as the segment format. Try to convert - * if not. */ - if (!gst_qtdemux_convert_seek (pad, &format, cur_type, &cur, - stop_type, &stop)) - goto no_format; + /* we have to have a format as the segment format. Try to convert + * if not. */ + if (!gst_qtdemux_convert_seek (pad, &format, cur_type, &cur, + stop_type, &stop)) + goto no_format; - GST_DEBUG_OBJECT (qtdemux, "seek format %s", gst_format_get_name (format)); - } else { - GST_DEBUG_OBJECT (qtdemux, "doing seek without event"); - flags = 0; - } + GST_DEBUG_OBJECT (qtdemux, "seek format %s", gst_format_get_name (format)); 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. */ memcpy (&seeksegment, &qtdemux->segment, sizeof (GstSegment)); - if (event) { - /* configure the segment with the seek variables */ - GST_DEBUG_OBJECT (qtdemux, "configuring seek"); - if (!gst_segment_do_seek (&seeksegment, rate, format, flags, - cur_type, cur, stop_type, stop, &update)) { - ret = FALSE; - GST_ERROR_OBJECT (qtdemux, "inconsistent seek values, doing nothing"); - } else { - /* now do the seek */ - ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags); - } + /* configure the segment with the seek variables */ + GST_DEBUG_OBJECT (qtdemux, "configuring seek"); + if (!gst_segment_do_seek (&seeksegment, rate, format, flags, + cur_type, cur, stop_type, stop, &update)) { + ret = FALSE; + GST_ERROR_OBJECT (qtdemux, "inconsistent seek values, doing nothing"); } else { /* now do the seek */ ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags); -- 2.7.4