qtdemux: Don't perform seeks with inconsistent seek values
If gst_segment_do_seek() fails, we shouldn't try seeking on that resulting segment but just error out. Crashes further down the line otherwise.
This commit is contained in:
parent
36b5dc0270
commit
a593e4966e
@ -1628,6 +1628,7 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event)
|
|||||||
GstSegment seeksegment;
|
GstSegment seeksegment;
|
||||||
guint32 seqnum = 0;
|
guint32 seqnum = 0;
|
||||||
GstEvent *flush_event;
|
GstEvent *flush_event;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
GST_DEBUG_OBJECT (qtdemux, "doing seek with event");
|
GST_DEBUG_OBJECT (qtdemux, "doing seek with event");
|
||||||
@ -1674,12 +1675,18 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event)
|
|||||||
if (event) {
|
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");
|
||||||
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;
|
||||||
|
GST_ERROR_OBJECT (qtdemux, "inconsistent seek values, doing nothing");
|
||||||
|
} else {
|
||||||
|
/* now do the seek */
|
||||||
|
ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* now do the seek */
|
||||||
|
ret = gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now do the seek, this actually never returns FALSE */
|
|
||||||
gst_qtdemux_perform_seek (qtdemux, &seeksegment, seqnum, flags);
|
|
||||||
|
|
||||||
/* prepare for streaming again */
|
/* prepare for streaming again */
|
||||||
if (flush) {
|
if (flush) {
|
||||||
@ -1708,7 +1715,7 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event)
|
|||||||
|
|
||||||
GST_PAD_STREAM_UNLOCK (qtdemux->sinkpad);
|
GST_PAD_STREAM_UNLOCK (qtdemux->sinkpad);
|
||||||
|
|
||||||
return TRUE;
|
return ret;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_format:
|
no_format:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user