asfdemux: Don't ignore the return result of gst_segment_do_seek()

gst_segment_do_seek() can fail, and our seek should fail
accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/45>
This commit is contained in:
Jan Schmidt 2020-04-01 19:34:30 +11:00 committed by GStreamer Merge Bot
parent c9e7490f46
commit ec9a1e8ef4

View file

@ -647,6 +647,7 @@ gst_asf_demux_handle_seek_push (GstASFDemux * demux, GstEvent * event)
static gboolean
gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
{
gboolean ret = TRUE;
GstClockTime idx_time;
GstSegment segment;
GstSeekFlags flags;
@ -748,8 +749,11 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
/* operating on copy of segment until we know the seek worked */
segment = demux->segment;
gst_segment_do_seek (&segment, rate, format, flags, cur_type,
cur, stop_type, stop, &only_need_update);
if (!gst_segment_do_seek (&segment, rate, format, flags, cur_type,
cur, stop_type, stop, &only_need_update)) {
ret = FALSE;
goto skip;
}
GST_DEBUG_OBJECT (demux, "seeking to time %" GST_TIME_FORMAT ", segment: "
"%" GST_SEGMENT_FORMAT, GST_TIME_ARGS (segment.start), &segment);
@ -837,7 +841,7 @@ skip:
/* streaming can continue now */
GST_PAD_STREAM_UNLOCK (demux->sinkpad);
return TRUE;
return ret;
}
static gboolean
@ -1400,9 +1404,12 @@ gst_asf_demux_check_segment_ts (GstASFDemux * demux, GstClockTime payload_ts)
demux->segment_ts = payload_ts;
/* always note, but only determines segment when streaming */
if (demux->streaming)
gst_segment_do_seek (&demux->segment, demux->in_segment.rate,
GST_FORMAT_TIME, (GstSeekFlags) demux->segment.flags,
GST_SEEK_TYPE_SET, demux->segment_ts, GST_SEEK_TYPE_NONE, 0, NULL);
if (!gst_segment_do_seek (&demux->segment, demux->in_segment.rate,
GST_FORMAT_TIME, (GstSeekFlags) demux->segment.flags,
GST_SEEK_TYPE_SET, demux->segment_ts, GST_SEEK_TYPE_NONE, 0,
NULL)) {
GST_WARNING_OBJECT (demux, "Initial segment seek failed");
}
}
}